Commit 8b1853c 1 parent 1975cd6 commit 8b1853c Copy full SHA for 8b1853c
File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import VerifyCodeLogin from './VerifyCodeLogin';
36
36
export function NavButtonStyle ( ) {
37
37
return 'h-12 relative rounded-t-xl text-gray-100 px-6 [&.active]:bg-gray-1400 [&.active]:!text-gray' ;
38
38
}
39
+ const EMAIL_FIELD_NAME = 'Email'
39
40
const SigninAfterStyle = 'after:content-[\'\'] after:absolute after:right-[-12px] after:bottom-0 after:w-3 after:h-3 after:bg-signin-gradient' ;
40
41
41
42
export default function Login ( ) {
@@ -60,9 +61,9 @@ export default function Login() {
60
61
setLoginType ( prevLoginType => {
61
62
const loginType = prevLoginType === 'verifyCode' ? 'password' : 'verifyCode' ;
62
63
clearErrors ( ) ;
63
- const email = getValues ( 'Email' )
64
+ const email = getValues ( EMAIL_FIELD_NAME )
64
65
reset ( ) ;
65
- setValue ( 'Email' , email )
66
+ setValue ( EMAIL_FIELD_NAME , email )
66
67
return loginType ;
67
68
} ) ;
68
69
} ;
@@ -103,7 +104,7 @@ export default function Login() {
103
104
}
104
105
} ;
105
106
106
- const emailField = register ( 'Email' , { required : true , pattern : / ^ \S + @ \S + $ / i } ) ;
107
+ const emailField = register ( EMAIL_FIELD_NAME , { required : true , pattern : / ^ \S + @ \S + $ / i } ) ;
107
108
emailField . onChange = wrapOnChange ( emailField . onChange ) ;
108
109
109
110
const pwdField = register ( 'Password' , {
You can’t perform that action at this time.
0 commit comments