aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/Authorization/Signup.jsx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/views/Authorization/Signup.jsx36
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