fix notification login
This commit is contained in:
@@ -8,7 +8,6 @@ import Page from '../../components/Page';
|
||||
import CardNotification from '../../sections/dashboard/CardNotification';
|
||||
import CardBalance from '../../sections/dashboard/CardBalance';
|
||||
import TableList from '../../sections/dashboard/TableList';
|
||||
import List from './List';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -57,7 +56,6 @@ export default function Dashboard() {
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<TableList />
|
||||
{/* <List /> */}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -11,6 +11,7 @@ import useAuth from '../../../hooks/useAuth';
|
||||
import useIsMountedRef from '../../../hooks/useIsMountedRef';
|
||||
/* ------------------------------- components ------------------------------- */
|
||||
import { FormProvider, RHFTextField } from '../../../components/hook-form';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
@@ -56,6 +57,10 @@ export default function LoginForm({ setEmailOrPhone, setLoginOrVerifyCode }: Log
|
||||
setEmailOrPhone(data.email);
|
||||
setLoginOrVerifyCode(true);
|
||||
reset();
|
||||
enqueueSnackbar('Kode OTP telah dikirim, silahkan cek email yang login', {
|
||||
variant: 'success',
|
||||
autoHideDuration: 2000,
|
||||
});
|
||||
} catch (error: any) {
|
||||
reset();
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import { FormProvider, RHFTextField } from '../../../components/hook-form';
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useAuth from '../../../hooks/useAuth';
|
||||
import useIsMountedRef from '../../../hooks/useIsMountedRef';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
@@ -56,6 +57,10 @@ export default function LoginPhoneForm({ setEmailOrPhone, setLoginOrVerifyCode }
|
||||
setEmailOrPhone(0 + data.phone);
|
||||
setLoginOrVerifyCode(true);
|
||||
reset();
|
||||
enqueueSnackbar('Kode OTP telah dikirim, silahkan cek pada nomor yang telah login', {
|
||||
variant: 'success',
|
||||
autoHideDuration: 2000,
|
||||
});
|
||||
} catch (error: any) {
|
||||
reset();
|
||||
|
||||
|
||||
@@ -88,7 +88,8 @@ export default function VerifyCodeForm({
|
||||
|
||||
const onSubmit = async (data: FormValuesProps) => {
|
||||
try {
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
enqueueSnackbar('Verify success!', { variant: 'success', autoHideDuration: 1000 });
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
// @ts-ignore
|
||||
const response: responseProps = await validateOtp(emailOrPhone, Object.values(data).join(''));
|
||||
|
||||
@@ -101,7 +102,7 @@ export default function VerifyCodeForm({
|
||||
}
|
||||
|
||||
navigate('/dashboard');
|
||||
enqueueSnackbar('Verify success!', { variant: 'success' });
|
||||
enqueueSnackbar('Login Berhasil!', { variant: 'success' });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user