diff --git a/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx b/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx index fb735082..5bc44c36 100644 --- a/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx +++ b/src/components/PageLayout/PasswordResetRequest/PasswordResetRequest.tsx @@ -1,3 +1,4 @@ +import {Stack} from '@mui/material' import {useMutation} from '@tanstack/react-query' import axios from 'axios' import {FC} from 'react' @@ -27,10 +28,6 @@ export const PasswordResetRequestForm: FC = ({closeOverla return axios.post('/api/user/password/reset', data) }, - onError: (error) => { - alert(error.message) - }, - onSuccess: () => { closeOverlay() }, @@ -42,19 +39,25 @@ export const PasswordResetRequestForm: FC = ({closeOverla return (
- - + + + + + + ) } diff --git a/src/components/PasswordReset/PasswordReset.tsx b/src/components/PasswordReset/PasswordReset.tsx index 741c8d7f..7d623b09 100644 --- a/src/components/PasswordReset/PasswordReset.tsx +++ b/src/components/PasswordReset/PasswordReset.tsx @@ -1,4 +1,4 @@ -import {Typography} from '@mui/material' +import {Stack, Typography} from '@mui/material' import {useMutation} from '@tanstack/react-query' import axios from 'axios' import {useRouter} from 'next/router' @@ -46,9 +46,6 @@ export const PasswordResetForm: FC = ({uid, token}) => { mutationFn: (data: PasswordResetForm) => { return axios.post('/api/user/password/reset/confirm', transformFormData(data)) }, - onError: (error) => { - alert(error.name) - }, }) const onSubmit: SubmitHandler = (data) => { @@ -58,44 +55,52 @@ export const PasswordResetForm: FC = ({uid, token}) => { if (isReset) return ( <> - Heslo úspešne zmenené, môžeš sa prihlásiť - { - router.push('/') - }} - /> + + Heslo úspešne zmenené, môžeš sa prihlásiť + { + router.push('/') + }} + /> + ) return ( <>
- - { - if (val !== getValues().password1) return '* Zadané heslá sa nezhodujú.' - }, - }} - /> - + + + { + if (val !== getValues().password1) return '* Zadané heslá sa nezhodujú.' + }, + }} + /> + + + + ) diff --git a/src/components/PasswordResetSent/PasswordResetSent.tsx b/src/components/PasswordResetSent/PasswordResetSent.tsx new file mode 100644 index 00000000..b079954c --- /dev/null +++ b/src/components/PasswordResetSent/PasswordResetSent.tsx @@ -0,0 +1,10 @@ +import {Typography} from '@mui/material' +import {FC} from 'react' + +export const PasswordResetSent: FC = () => { + return ( + + Ak existuje účet so zadaným e-mailom, poslali sme ti naňho link pre zmenu hesla. + + ) +} diff --git a/src/components/Verification/Verification.tsx b/src/components/Verification/Verification.tsx index b916cada..daff59ec 100644 --- a/src/components/Verification/Verification.tsx +++ b/src/components/Verification/Verification.tsx @@ -1,5 +1,6 @@ +import {Typography} from '@mui/material' import {FC} from 'react' export const Verification: FC = () => { - return
Verifikačný e-mail bol odoslaný na zadanú e-mailovú adresu.
+ return Verifikačný e-mail bol odoslaný na zadanú e-mailovú adresu. } diff --git a/src/pages/malynar/reset-sent/index.tsx b/src/pages/malynar/reset-sent/index.tsx new file mode 100644 index 00000000..1256e1d5 --- /dev/null +++ b/src/pages/malynar/reset-sent/index.tsx @@ -0,0 +1,15 @@ +import {NextPage} from 'next' + +import {PasswordResetSent} from '@/components/PasswordResetSent/PasswordResetSent' + +import {PageLayout} from '../../../components/PageLayout/PageLayout' + +const Verifikacia: NextPage = () => { + return ( + + + + ) +} + +export default Verifikacia diff --git a/src/pages/matik/reset-sent/index.tsx b/src/pages/matik/reset-sent/index.tsx new file mode 100644 index 00000000..1256e1d5 --- /dev/null +++ b/src/pages/matik/reset-sent/index.tsx @@ -0,0 +1,15 @@ +import {NextPage} from 'next' + +import {PasswordResetSent} from '@/components/PasswordResetSent/PasswordResetSent' + +import {PageLayout} from '../../../components/PageLayout/PageLayout' + +const Verifikacia: NextPage = () => { + return ( + + + + ) +} + +export default Verifikacia diff --git a/src/pages/strom/reset-sent/index.tsx b/src/pages/strom/reset-sent/index.tsx new file mode 100644 index 00000000..1256e1d5 --- /dev/null +++ b/src/pages/strom/reset-sent/index.tsx @@ -0,0 +1,15 @@ +import {NextPage} from 'next' + +import {PasswordResetSent} from '@/components/PasswordResetSent/PasswordResetSent' + +import {PageLayout} from '../../../components/PageLayout/PageLayout' + +const Verifikacia: NextPage = () => { + return ( + + + + ) +} + +export default Verifikacia