1
1
import { useNavigation } from "@react-navigation/native" ;
2
2
import to from "await-to-js" ;
3
3
import { signInWithEmailAndPassword , onAuthStateChanged } from "firebase/auth" ;
4
- import React , { useState , useEffect } from "react" ;
4
+ import React , { useState , useEffect , useRef } from "react" ;
5
5
import {
6
6
View ,
7
7
Text ,
@@ -19,9 +19,10 @@ export default function Login() {
19
19
20
20
const [ email , setEmail ] = useState ( "" ) ;
21
21
const [ password , setPassword ] = useState ( "" ) ;
22
-
23
22
const [ errorMsg , setErrorMsg ] = useState ( "" ) ;
24
23
24
+ const passwordInputRef = useRef ( null ) ;
25
+
25
26
const navigation = useNavigation ( ) ;
26
27
27
28
useEffect ( ( ) => {
@@ -77,7 +78,10 @@ export default function Login() {
77
78
autoCapitalize = "none"
78
79
placeholder = "Email"
79
80
placeholderTextColor = "#bebebe"
81
+ returnKeyType = "next"
82
+ keyboardType = "email-address"
80
83
onChangeText = { setEmail }
84
+ onSubmitEditing = { ( ) => passwordInputRef . current . focus ( ) }
81
85
value = { email }
82
86
/>
83
87
< TextInput
@@ -87,10 +91,13 @@ export default function Login() {
87
91
AppStyles . lightText ,
88
92
] }
89
93
placeholder = "Password"
90
- placeholderTextColor = "#bebebe"
94
+ placeholderTextColor = "#DCDCDC"
95
+ returnKeyType = "go"
91
96
secureTextEntry
92
97
onChangeText = { setPassword }
98
+ onSubmitEditing = { validate }
93
99
value = { password }
100
+ ref = { passwordInputRef }
94
101
/>
95
102
< View style = { AppStyles . rowContainer } >
96
103
< InlineBtn onPress = { ( ) => navigation . navigate ( "ResetPassword" ) } >
0 commit comments