diff options
-rw-r--r-- | src/components/common/LoginInput.tsx | 4 | ||||
-rw-r--r-- | src/screens/Login.tsx | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/components/common/LoginInput.tsx b/src/components/common/LoginInput.tsx index 43c31e2b..c82682d7 100644 --- a/src/components/common/LoginInput.tsx +++ b/src/components/common/LoginInput.tsx @@ -54,7 +54,7 @@ const LoginInput = (props: LoginInputProps) => { secureTextEntry={ props.isUsername ? false : props.isPassword ? true : false } - // focus={props.isUsername ? undefined : props.focusPasswordInput} + // ref={props.ref} /> {!props.isValid && ( <Text style={styles.invalidCredentials}>{props.validationWarning}</Text> @@ -88,7 +88,7 @@ interface LoginInputProps { isPassword?: boolean; onChangeText: (input: string) => void; onSubmitEditing?: () => void; - // ref: PropTypes.any, + // ref?: string; focusPasswordInput?: boolean; isValid?: boolean; validationWarning?: string; diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx index c6f23c03..6384eff1 100644 --- a/src/screens/Login.tsx +++ b/src/screens/Login.tsx @@ -25,6 +25,7 @@ interface LoginProps { route: LoginScreenRouteProp; navigation: LoginScreenNavigationProp; } + const Login = ({navigation}: LoginProps) => { // const passwordInput = useRef(); const [data, setData] = React.useState({ @@ -85,7 +86,6 @@ const Login = ({navigation}: LoginProps) => { Alert.alert( `My favorite Girl Scout Cookies are taggalongs! What are yours ${data.username}?`, ); - navigation.navigate('Registration'); } }; @@ -98,8 +98,13 @@ const Login = ({navigation}: LoginProps) => { // focusPasswordInput: true, // }); Alert.alert('Coming soon 🚧'); + // refs.password_input.focus() }; + const handleRegistration = () => { + navigation.navigate('Registration'); + } + return ( <> <StatusBar barStyle="light-content" /> @@ -125,6 +130,7 @@ const Login = ({navigation}: LoginProps) => { onSubmitEditing={() => handleUsernameSubmit()} isValid={data.isValidUser} validationWarning={'Username must be at least 6 characters long.'} + // ref={'username_input'} /> <LoginInput type={data.password} @@ -134,6 +140,7 @@ const Login = ({navigation}: LoginProps) => { onSubmitEditing={() => handleLogin()} isValid={data.isValidPassword} validationWarning={'Password must be at least 8 characters long.'} + // ref={'password_input'} /> <TouchableOpacity accessibilityLabel="Forgot password button" @@ -159,9 +166,7 @@ const Login = ({navigation}: LoginProps) => { accessibilityLabel="Get started" accessibilityHint="Select this if you do not have a tagg account" style={styles.getStarted} - onPress={() => - Alert.alert('I get the tagg flip it and tumble it.') - }> + onPress={() => handleRegistration()}> Get started! </Text> </Text> |