Last active
March 16, 2021 18:05
-
-
Save rasikag/e35f95a28ddb5f1f1f66a44a8746e57a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [complete, setComplete] = userState(false); | |
const [, forgotPassword] = useForgotPasswordMutation(); | |
return ( | |
<Wrapper variant="small"> | |
<Formik | |
initialValues={{ email: "" }} | |
onSubmit={async (values) => { | |
await forgotPassword(values); | |
setComplete(true); | |
}} | |
> | |
{({ isSubmitting }) => | |
complete ? ( | |
<Box>we sent a password reset link to your email. Please check.</Box> | |
) : ( | |
<Form> | |
<InputField | |
name="email" | |
placeholder="email" | |
label="Email" | |
type="email" | |
/> | |
<Button | |
isLoading={isSubmitting} | |
mt={4} | |
type="submit" | |
colorScheme="teal" | |
> | |
Forgot Password | |
</Button> | |
</Form> | |
) | |
} | |
</Formik> | |
</Wrapper> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment