Skip to content

Instantly share code, notes, and snippets.

@rasikag
Last active March 16, 2021 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasikag/e35f95a28ddb5f1f1f66a44a8746e57a to your computer and use it in GitHub Desktop.
Save rasikag/e35f95a28ddb5f1f1f66a44a8746e57a to your computer and use it in GitHub Desktop.
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