From 81c3757f3544d6731488946846461997140f8fa4 Mon Sep 17 00:00:00 2001 From: vgeffer Date: Sat, 9 Dec 2023 15:15:26 +0100 Subject: [PATCH] feat(pass-reset): added functionality to pass reset dialog --- .../LoginFormWrapper/LoginFormWrapper.tsx | 10 +++++++++- .../PasswordReset/PasswordResetRequest.tsx | 6 ++++++ .../malynar/reset-verification-sent/index.tsx | 15 +++++++++++++++ src/pages/matik/reset-verification-sent/index.tsx | 15 +++++++++++++++ src/pages/strom/reset-verification-sent/index.tsx | 15 +++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/pages/malynar/reset-verification-sent/index.tsx create mode 100644 src/pages/matik/reset-verification-sent/index.tsx create mode 100644 src/pages/strom/reset-verification-sent/index.tsx diff --git a/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx b/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx index f2381dfe..da858fde 100644 --- a/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx +++ b/src/components/PageLayout/LoginFormWrapper/LoginFormWrapper.tsx @@ -1,3 +1,4 @@ +import {useRouter} from 'next/router' import {FC, useState} from 'react' import {Button} from '@/components/Clickable/Clickable' @@ -10,6 +11,7 @@ export interface ILoginFormWrapper { } export const LoginFormWrapper: FC = ({closeOverlay}) => { + const router = useRouter() const [form, changeForm] = useState('login') if (form === 'login') @@ -26,5 +28,11 @@ export const LoginFormWrapper: FC = ({closeOverlay}) => { ) - return + return ( + { + router.push('/reset-verification-sent') + }} + /> + ) } diff --git a/src/components/PageLayout/PasswordReset/PasswordResetRequest.tsx b/src/components/PageLayout/PasswordReset/PasswordResetRequest.tsx index 9b211cdd..129bbcde 100644 --- a/src/components/PageLayout/PasswordReset/PasswordResetRequest.tsx +++ b/src/components/PageLayout/PasswordReset/PasswordResetRequest.tsx @@ -27,6 +27,12 @@ export const PasswordResetRequestForm: FC = ({closeOverlay}) mutationFn: (data: PasswordResetRequestFormValues) => { return axios.post('/api/user/password/reset/', data) }, + + onError: (error, variables, context) => {}, + + onSuccess: () => { + closeOverlay() + }, }) const onSubmit: SubmitHandler = (data) => { diff --git a/src/pages/malynar/reset-verification-sent/index.tsx b/src/pages/malynar/reset-verification-sent/index.tsx new file mode 100644 index 00000000..5ffc20cb --- /dev/null +++ b/src/pages/malynar/reset-verification-sent/index.tsx @@ -0,0 +1,15 @@ +import {NextPage} from 'next' + +import {Verification} from '@/components/Verification/Verification' + +import {PageLayout} from '../../../components/PageLayout/PageLayout' + +const PasswordResetRequest: NextPage = () => { + return ( + + + + ) +} + +export default PasswordResetRequest diff --git a/src/pages/matik/reset-verification-sent/index.tsx b/src/pages/matik/reset-verification-sent/index.tsx new file mode 100644 index 00000000..5ffc20cb --- /dev/null +++ b/src/pages/matik/reset-verification-sent/index.tsx @@ -0,0 +1,15 @@ +import {NextPage} from 'next' + +import {Verification} from '@/components/Verification/Verification' + +import {PageLayout} from '../../../components/PageLayout/PageLayout' + +const PasswordResetRequest: NextPage = () => { + return ( + + + + ) +} + +export default PasswordResetRequest diff --git a/src/pages/strom/reset-verification-sent/index.tsx b/src/pages/strom/reset-verification-sent/index.tsx new file mode 100644 index 00000000..5ffc20cb --- /dev/null +++ b/src/pages/strom/reset-verification-sent/index.tsx @@ -0,0 +1,15 @@ +import {NextPage} from 'next' + +import {Verification} from '@/components/Verification/Verification' + +import {PageLayout} from '../../../components/PageLayout/PageLayout' + +const PasswordResetRequest: NextPage = () => { + return ( + + + + ) +} + +export default PasswordResetRequest