From e14aa527afe5ad593c7856163ec19d77bc49033d Mon Sep 17 00:00:00 2001 From: jjstnlee Date: Thu, 18 Apr 2024 21:15:05 -0700 Subject: [PATCH] Fixed keyboard bug on signup page --- src/app/auth/signup/index.tsx | 247 +++++++++++++++++----------------- 1 file changed, 124 insertions(+), 123 deletions(-) diff --git a/src/app/auth/signup/index.tsx b/src/app/auth/signup/index.tsx index fbaeb5c..17608b4 100644 --- a/src/app/auth/signup/index.tsx +++ b/src/app/auth/signup/index.tsx @@ -1,20 +1,20 @@ import { Link, router } from 'expo-router'; import { useEffect, useRef, useState } from 'react'; -import { Alert, Text, View } from 'react-native'; +import { Alert, KeyboardAvoidingView, Text, View } from 'react-native'; import { Icon as RNEIcon } from 'react-native-elements'; import { ScrollView } from 'react-native-gesture-handler'; import { SafeAreaView } from 'react-native-safe-area-context'; import validator from 'validator'; import styles from './styles'; +import PasswordComplexityText from '../../../components/PasswordComplexityText/PasswordComplexityText'; import StyledButton from '../../../components/StyledButton/StyledButton'; import UserStringInput from '../../../components/UserStringInput/UserStringInput'; -import PasswordComplexityText from '../../../components/PasswordComplexityText/PasswordComplexityText'; +import { isEmailTaken } from '../../../queries/profiles'; import colors from '../../../styles/colors'; import globalStyles from '../../../styles/globalStyles'; import { useSession } from '../../../utils/AuthContext'; import supabase from '../../../utils/supabase'; -import { isEmailTaken } from '../../../queries/profiles'; function SignUpScreen() { const { signUp } = useSession(); @@ -143,133 +143,134 @@ function SignUpScreen() { style={[globalStyles.authContainer]} edges={['right', 'left', 'top']} > - - - - {'Read stories from \nyoung creators'} - - - - {usernameError && ( - - {usernameError} + + + + + {'Read stories from \nyoung creators'} - )} - - - - {emailError && ( - - {emailError} - - )} - - { - setPassword(text); - checkPassword(text); - }} - value={password} - attributes={{ - textContentType: 'password', - secureTextEntry: passwordTextHidden, - }} - > - setPasswordTextHidden(!passwordTextHidden)} + - - - {password !== '' && ( - - )} - {password !== '' && ( - - )} - {password !== '' && ( - - )} - {password !== '' && ( - - )} + {usernameError && ( + + {usernameError} + + )} - - - + + + {emailError && ( + + {emailError} + + )} + + { + setPassword(text); + checkPassword(text); + }} + value={password} + attributes={{ + textContentType: 'password', + secureTextEntry: passwordTextHidden, + }} + > + setPasswordTextHidden(!passwordTextHidden)} + /> + - - Already have an account? - - Log In - + {password !== '' && ( + + )} + {password !== '' && ( + + )} + {password !== '' && ( + + )} + {password !== '' && ( + + )} + + + + + + + Already have an account? + + Log In + + - - + + ); }