feat: add forgot password page

This commit is contained in:
Ali BARIN
2023-03-03 14:38:54 +00:00
parent cc05bc7db8
commit 4792853eb6
9 changed files with 122 additions and 6 deletions

View File

@@ -11,6 +11,7 @@ import * as URLS from 'config/urls';
import { LOGIN } from 'graphql/mutations/login';
import Form from 'components/Form';
import TextField from 'components/TextField';
import useFormatMessage from 'hooks/useFormatMessage';
function renderFields(props: { loading: boolean }) {
const { loading = false } = props;
@@ -37,8 +38,17 @@ function renderFields(props: { loading: boolean }) {
margin="dense"
autoComplete="current-password"
data-test="password-text-field"
sx={{ mb: 1 }}
/>
<Link
component={RouterLink}
to={URLS.FORGOT_PASSWORD}
underline="none"
>
Forgot password?
</Link>
<LoadingButton
type="submit"
variant="contained"
@@ -64,6 +74,7 @@ function renderFields(props: { loading: boolean }) {
function LoginForm() {
const navigate = useNavigate();
const formatMessage = useFormatMessage();
const authentication = useAuthentication();
const [login, { loading }] = useMutation(LOGIN);
@@ -100,7 +111,7 @@ function LoginForm() {
}}
gutterBottom
>
Login
{formatMessage('loginForm.title')}
</Typography>
<Form onSubmit={handleSubmit} render={render} />