Update Add user hospital portal
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react';
|
||||
import { useState, useContext } from 'react';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
// @mui
|
||||
import { styled } from '@mui/material/styles';
|
||||
@@ -13,6 +13,9 @@ import Page from '@/components/Page';
|
||||
import { ResetPasswordForm } from '@/sections/auth/reset-password';
|
||||
// assets
|
||||
import { SentIcon } from '@/assets';
|
||||
import { LanguageContext } from '@/contexts/LanguageContext';
|
||||
|
||||
import { useNavigate } from 'react-router-dom'; // Import useNavigate
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -27,10 +30,17 @@ const RootStyle = styled('div')(({ theme }) => ({
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function ResetPassword() {
|
||||
const { localeData } = useContext(LanguageContext);
|
||||
const [email, setEmail] = useState('');
|
||||
|
||||
const [sent, setSent] = useState(false);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleSent = () => {
|
||||
setSent(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<Page title="Reset Password" sx={{ height: 1 }}>
|
||||
<RootStyle>
|
||||
@@ -41,16 +51,15 @@ export default function ResetPassword() {
|
||||
{!sent ? (
|
||||
<>
|
||||
<Typography variant="h3" paragraph>
|
||||
Forgot your password?
|
||||
{localeData.txtForgotYourPassword}
|
||||
</Typography>
|
||||
|
||||
<Typography sx={{ color: 'text.secondary', mb: 5 }}>
|
||||
Please enter the email address associated with your account and We will email you
|
||||
a link to reset your password.
|
||||
{localeData.txtPleaseEnterPassword}
|
||||
</Typography>
|
||||
|
||||
<ResetPasswordForm
|
||||
onSent={() => setSent(true)}
|
||||
onSent={handleSent}
|
||||
onGetEmail={(value) => setEmail(value)}
|
||||
/>
|
||||
|
||||
@@ -61,7 +70,7 @@ export default function ResetPassword() {
|
||||
to={PATH_AUTH.login}
|
||||
sx={{ mt: 3 }}
|
||||
>
|
||||
Back
|
||||
{localeData.txtBack}
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
@@ -69,24 +78,24 @@ export default function ResetPassword() {
|
||||
<SentIcon sx={{ mb: 5, mx: 'auto', height: 160 }} />
|
||||
|
||||
<Typography variant="h3" gutterBottom>
|
||||
Request sent successfully
|
||||
{localeData.txtSuccessSend}
|
||||
</Typography>
|
||||
|
||||
<Typography>
|
||||
We have sent a confirmation email to
|
||||
{localeData.txtCodeConfirm}
|
||||
<strong>{email}</strong>
|
||||
<br />
|
||||
Please check your email.
|
||||
{localeData.txtPleasCheck}
|
||||
</Typography>
|
||||
|
||||
<Button
|
||||
size="large"
|
||||
variant="contained"
|
||||
component={RouterLink}
|
||||
to={PATH_AUTH.login}
|
||||
to={PATH_AUTH.verify}
|
||||
sx={{ mt: 5 }}
|
||||
>
|
||||
Back
|
||||
Next
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user