mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-18 05:09:23 +00:00
lint everything
This commit is contained in:
@@ -9,51 +9,55 @@ import { z } from 'zod'
|
||||
import s from './recover-password.module.scss'
|
||||
|
||||
const schema = z.object({
|
||||
email: z.string().email('Invalid email address').nonempty('Enter email'),
|
||||
email: z.string().email('Invalid email address').nonempty('Enter email'),
|
||||
})
|
||||
|
||||
type FormType = z.infer<typeof schema>
|
||||
|
||||
type Props = {
|
||||
onSubmit: (data: FormType) => void
|
||||
onSubmit: (data: FormType) => void
|
||||
}
|
||||
|
||||
export const RecoverPassword = (props: Props) => {
|
||||
const { control, handleSubmit } = useForm<FormType>({
|
||||
defaultValues: {
|
||||
email: '',
|
||||
},
|
||||
mode: 'onSubmit',
|
||||
resolver: zodResolver(schema),
|
||||
})
|
||||
const { control, handleSubmit } = useForm<FormType>({
|
||||
defaultValues: {
|
||||
email: '',
|
||||
},
|
||||
mode: 'onSubmit',
|
||||
resolver: zodResolver(schema),
|
||||
})
|
||||
|
||||
const handleFormSubmitted = handleSubmit(props.onSubmit)
|
||||
const handleFormSubmitted = handleSubmit(props.onSubmit)
|
||||
|
||||
return (
|
||||
<>
|
||||
<DevTool control={control} />
|
||||
<Card className={s.card}>
|
||||
<Typography className={s.title} variant={'large'}>
|
||||
Forgot your password?
|
||||
</Typography>
|
||||
<form onSubmit={handleFormSubmitted}>
|
||||
<div className={s.form}>
|
||||
<ControlledTextField control={control} name={'email'} placeholder={'Email'} />
|
||||
</div>
|
||||
<Typography className={s.instructions} variant={'body2'}>
|
||||
Enter your email address and we will send you further instructions
|
||||
</Typography>
|
||||
<Button className={s.button} fullWidth type={'submit'}>
|
||||
Send Instructions
|
||||
</Button>
|
||||
</form>
|
||||
<Typography className={s.caption} variant={'body2'}>
|
||||
Did you remember your password?
|
||||
</Typography>
|
||||
<Typography as={Link} className={s.loginLink} to={'/sign-in'} variant={'link1'}>
|
||||
Try logging in
|
||||
</Typography>
|
||||
</Card>
|
||||
</>
|
||||
)
|
||||
return (
|
||||
<>
|
||||
<DevTool control={control} />
|
||||
<Card className={s.card}>
|
||||
<Typography className={s.title} variant={'large'}>
|
||||
Forgot your password?
|
||||
</Typography>
|
||||
<form onSubmit={handleFormSubmitted}>
|
||||
<div className={s.form}>
|
||||
<ControlledTextField
|
||||
control={control}
|
||||
name={'email'}
|
||||
placeholder={'Email'}
|
||||
/>
|
||||
</div>
|
||||
<Typography className={s.instructions} variant={'body2'}>
|
||||
Enter your email address and we will send you further instructions
|
||||
</Typography>
|
||||
<Button className={s.button} fullWidth type={'submit'}>
|
||||
Send Instructions
|
||||
</Button>
|
||||
</form>
|
||||
<Typography className={s.caption} variant={'body2'}>
|
||||
Did you remember your password?
|
||||
</Typography>
|
||||
<Typography as={Link} className={s.loginLink} to={'/sign-in'} variant={'link1'}>
|
||||
Try logging in
|
||||
</Typography>
|
||||
</Card>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user