diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-05 17:28:47 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-05 17:28:47 -0400 |
commit | c34da50c8c1564c9c6556522bf12a93639c1f160 (patch) | |
tree | 22690c5d8efe866f3f97bf479115d6914f579824 /src/views/Authorization | |
parent | 71bad5a19f8aea358b3f21dde4f69fd53a870184 (diff) | |
download | donetick-frontend-c34da50c8c1564c9c6556522bf12a93639c1f160.tar.gz donetick-frontend-c34da50c8c1564c9c6556522bf12a93639c1f160.tar.bz2 donetick-frontend-c34da50c8c1564c9c6556522bf12a93639c1f160.zip |
Add NFC tag writing functionality to ChoreCard component, Add Email to sign up
Diffstat (limited to '')
-rw-r--r-- | src/views/Authorization/Signup.jsx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/views/Authorization/Signup.jsx b/src/views/Authorization/Signup.jsx index d83411f..a1e312c 100644 --- a/src/views/Authorization/Signup.jsx +++ b/src/views/Authorization/Signup.jsx @@ -60,10 +60,10 @@ const SignupView = () => { setUsernameError('Username must be at least 4 characters') isValid = false } - // if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { - // setEmailError('Invalid email address') - // isValid = false - // } + if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { + setEmailError('Invalid email address') + isValid = false + } if (password.length < 8) { setPasswordError('Password must be at least 8 characters') @@ -158,10 +158,10 @@ const SignupView = () => { margin='normal' required fullWidth - id='email' - label='Email Address' - name='email' - autoComplete='email' + id='username' + label='Username' + name='username' + autoComplete='username' autoFocus value={username} onChange={e => { @@ -174,6 +174,26 @@ const SignupView = () => { </FormControl> {/* Error message display */} <Typography level='body2' alignSelf={'start'}> + Email + </Typography> + <Input + margin='normal' + required + fullWidth + id='email' + label='email' + name='email' + autoComplete='email' + value={email} + onChange={e => { + setEmailError(null) + setEmail(e.target.value.trim()) + }} + /> + <FormControl error={emailError}> + <FormHelperText c>{emailError}</FormHelperText> + </FormControl> + <Typography level='body2' alignSelf={'start'}> Password: </Typography> <Input |