import { useMutation } from '@apollo/client'; import { Button, makeStyles, Theme } from '@material-ui/core'; import gql from 'graphql-tag'; import * as React from 'react'; import { Field, FormRenderProps } from 'react-final-form'; import { Link } from 'react-router-dom'; import Form from '../../components/Form'; import Input from '../../components/form/TextField'; import { ResetPassword, ResetPasswordVariables } from '../../graphql'; import { required } from '../../util/validation'; import AccountPage from './AccountPage'; const useStyles = makeStyles((theme: Theme) => ({ submit: { width: '100%', marginTop: theme.spacing(4), }, google: { width: '100%', marginTop: theme.spacing(4), background: theme.palette.common.white, }, })); const resetPasswordMutation = gql` mutation ResetPassword($email: String!) { resetPassword(email: $email) } `; const Reset = () => { const classes = useStyles(); const [resetPassword] = useMutation(resetPasswordMutation); return ( Signing in? } > onSubmit={variables => resetPassword({ variables })} successMessage="Password reset email has been sent" render={({ handleSubmit, submitting }: FormRenderProps) => (
)} />
); }; export default Reset;