From 2a56dc47e0afe67ca3c2bcc7b961c4af01b8d4e1 Mon Sep 17 00:00:00 2001 From: Mohamed Hadri Date: Wed, 31 Aug 2022 22:32:26 +0300 Subject: [PATCH] feat: added toast check for the email and removed unnecessary inputs resolve #97 --- src/components/EditProfile/EditProfile.jsx | 22 +++++++++++-------- .../__snapshots__/EditProfile.test.jsx.snap | 14 ------------ 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/components/EditProfile/EditProfile.jsx b/src/components/EditProfile/EditProfile.jsx index b653131..51e3c3d 100644 --- a/src/components/EditProfile/EditProfile.jsx +++ b/src/components/EditProfile/EditProfile.jsx @@ -38,9 +38,18 @@ export default function EditProfile() { .catch(() => {}); }; - const resetUserPassword = async () => { - await resetPassword(emailRef.current.value); - console.log("check your inbox for futher instructions"); + const resetUserPassword = async (event) => { + event.preventDefault(); + + await resetPassword(emailRef.current.value) + .then(() => { + toast.success( + t( + "Check your inbox we Sent you a link to reset your password" + ) + "!" + ); + }) + .catch(() => {}); }; return ( @@ -70,11 +79,6 @@ export default function EditProfile() { ref={emailRef} /> - -
@@ -93,7 +97,7 @@ export default function EditProfile() {