From c34da50c8c1564c9c6556522bf12a93639c1f160 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Fri, 5 Jul 2024 17:28:47 -0400 Subject: Add NFC tag writing functionality to ChoreCard component, Add Email to sign up --- src/views/Authorization/Signup.jsx | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'src/views/Authorization') 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 => { @@ -173,6 +173,26 @@ const SignupView = () => { {usernameError} {/* Error message display */} + + Email + + { + setEmailError(null) + setEmail(e.target.value.trim()) + }} + /> + + {emailError} + Password: -- cgit