feat: interact with user settings/profile (#9)

This commit is contained in:
Divlo
2022-02-19 23:20:33 +01:00
committed by GitHub
parent 48debe8638
commit 7ac4f86cd5
101 changed files with 6705 additions and 9777 deletions

View File

@ -22,7 +22,10 @@ const ForgotPassword: NextPage<FooterProps> = (props) => {
const { version } = props
const { fetchState, message, errors, getErrorTranslation, handleSubmit } =
useForm({ validateSchemaObject: { email: userSchema.email } })
useForm({
validateSchema: { email: userSchema.email },
resetOnSuccess: true
})
const onSubmit: HandleSubmitCallback = async (formData) => {
try {
@ -55,10 +58,10 @@ const ForgotPassword: NextPage<FooterProps> = (props) => {
<Main>
<AuthenticationForm onSubmit={handleSubmit(onSubmit)}>
<Input type='email' placeholder='Email' name='email' label='Email' />
<Button data-cy='submit' className='w-full mt-6' type='submit'>
<Button data-cy='submit' className='mt-6 w-full' type='submit'>
{t('authentication:submit')}
</Button>
<p className='mt-3 font-headline text-sm text-green-800 dark:text-green-400 hover:underline'>
<p className='mt-3 font-headline text-sm text-green-800 hover:underline dark:text-green-400'>
<Link href='/authentication/signin'>
<a>{t('authentication:already-know-password')}</a>
</Link>

View File

@ -23,7 +23,10 @@ const ResetPassword: NextPage<FooterProps> = (props) => {
const { version } = props
const { fetchState, message, errors, getErrorTranslation, handleSubmit } =
useForm({ validateSchemaObject: { password: userSchema.password } })
useForm({
validateSchema: { password: userSchema.password },
resetOnSuccess: true
})
const onSubmit: HandleSubmitCallback = async (formData) => {
try {
@ -59,7 +62,7 @@ const ResetPassword: NextPage<FooterProps> = (props) => {
name='password'
label='Password'
/>
<Button data-cy='submit' className='w-full mt-6' type='submit'>
<Button data-cy='submit' className='mt-6 w-full' type='submit'>
{t('authentication:submit')}
</Button>
</AuthenticationForm>