chore: useToast replaced with all Toast components used in feature
This commit is contained in:
2092
package-lock.json
generated
2092
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@
|
|||||||
"@mui/stylis-plugin-rtl": "^7.2.0",
|
"@mui/stylis-plugin-rtl": "^7.2.0",
|
||||||
"@rkheftan/harmony-ui": "^0.1.6",
|
"@rkheftan/harmony-ui": "^0.1.6",
|
||||||
"@types/stylis": "^4.2.7",
|
"@types/stylis": "^4.2.7",
|
||||||
|
"axios": "^1.11.0",
|
||||||
"i18next": "^25.3.0",
|
"i18next": "^25.3.0",
|
||||||
"i18next-browser-languagedetector": "^8.2.0",
|
"i18next-browser-languagedetector": "^8.2.0",
|
||||||
"i18next-http-backend": "^3.0.2",
|
"i18next-http-backend": "^3.0.2",
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Toast } from '@/components/Toast';
|
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import type { AuthType } from '../../types/authTypes';
|
import type { AuthType } from '../../types/authTypes';
|
||||||
import type { CountryCode, GUID } from '@/types/commonTypes';
|
import type { CountryCode, GUID } from '@/types/commonTypes';
|
||||||
@@ -20,6 +19,7 @@ import {
|
|||||||
sendSmsOtp,
|
sendSmsOtp,
|
||||||
} from '../../api/authorizationAPI';
|
} from '../../api/authorizationAPI';
|
||||||
import type { PasswordLoginRequest } from '../../types/userTypes';
|
import type { PasswordLoginRequest } from '../../types/userTypes';
|
||||||
|
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
export interface EnterPasswordFormProps {
|
export interface EnterPasswordFormProps {
|
||||||
onEditValue: () => void;
|
onEditValue: () => void;
|
||||||
@@ -49,9 +49,8 @@ export const EnterPasswordForm = ({
|
|||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
const [loginLoading, setLoginLoading] = useState<boolean>(false);
|
const [loginLoading, setLoginLoading] = useState<boolean>(false);
|
||||||
const [isLoginStatusSuccess, setIsLoginStatusSuccess] = useState<boolean>();
|
const [isLoginStatusSuccess, setIsLoginStatusSuccess] = useState<boolean>();
|
||||||
const [loginAlertOpen, setLoginAlertOpen] = useState<boolean>(false);
|
|
||||||
const [loginFailedMessage, setLoginFailedMessage] = useState<string>('');
|
|
||||||
const [sendOtpLoading, setSendOtpLoading] = useState<boolean>(false);
|
const [sendOtpLoading, setSendOtpLoading] = useState<boolean>(false);
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
const handleBlur = () => {
|
const handleBlur = () => {
|
||||||
setInputTouched(true);
|
setInputTouched(true);
|
||||||
@@ -76,11 +75,18 @@ export const EnterPasswordForm = ({
|
|||||||
if (jsonRes.success) {
|
if (jsonRes.success) {
|
||||||
setIsLoginStatusSuccess(true);
|
setIsLoginStatusSuccess(true);
|
||||||
onLoggedIn(jsonRes.userId);
|
onLoggedIn(jsonRes.userId);
|
||||||
|
|
||||||
|
toast({
|
||||||
|
message: t('verify.youHaveSuccessfullyLoggedIn'),
|
||||||
|
severity: 'success',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setIsLoginStatusSuccess(false);
|
setIsLoginStatusSuccess(false);
|
||||||
setLoginFailedMessage(jsonRes.message);
|
toast({
|
||||||
|
message: jsonRes.message,
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
setLoginAlertOpen(true);
|
|
||||||
setLoginLoading(false);
|
setLoginLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -100,16 +106,6 @@ export const EnterPasswordForm = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
open={loginAlertOpen}
|
|
||||||
onClose={() => setLoginAlertOpen(false)}
|
|
||||||
color={!isLoginStatusSuccess ? 'error' : 'success'}
|
|
||||||
>
|
|
||||||
{!isLoginStatusSuccess
|
|
||||||
? loginFailedMessage
|
|
||||||
: t('verify.youHaveSuccessfullyLoggedIn')}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -128,7 +124,7 @@ export const EnterPasswordForm = ({
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="large"
|
size="large"
|
||||||
sx={{ width: 'auto' }}
|
sx={{ width: 'auto' }}
|
||||||
endIcon={<Edit2 />}
|
endIcon={<Icon Component={Edit2} />}
|
||||||
onClick={onEditValue}
|
onClick={onEditValue}
|
||||||
>
|
>
|
||||||
{emailOrPhone}
|
{emailOrPhone}
|
||||||
@@ -159,7 +155,11 @@ export const EnterPasswordForm = ({
|
|||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => setShowPassword(!showPassword)}
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
>
|
>
|
||||||
{showPassword ? <Eye /> : <EyeSlash />}
|
{showPassword ? (
|
||||||
|
<Icon Component={Eye} />
|
||||||
|
) : (
|
||||||
|
<Icon Component={EyeSlash} />
|
||||||
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -172,7 +172,7 @@ export const EnterPasswordForm = ({
|
|||||||
sx={{ width: 'auto', mb: 2 }}
|
sx={{ width: 'auto', mb: 2 }}
|
||||||
variant="text"
|
variant="text"
|
||||||
loading={sendOtpLoading}
|
loading={sendOtpLoading}
|
||||||
endIcon={<ArrowLeft />}
|
endIcon={<Icon Component={ArrowLeft} />}
|
||||||
>
|
>
|
||||||
{t('enterPassword.loginWithOneTimeCode')}
|
{t('enterPassword.loginWithOneTimeCode')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type { GoogleCodeClientResponse } from '../../types/userTypes';
|
|||||||
import { loginOrSignUpWithGoogle } from '../../api/authorizationAPI';
|
import { loginOrSignUpWithGoogle } from '../../api/authorizationAPI';
|
||||||
import type { GUID } from '@/types/commonTypes';
|
import type { GUID } from '@/types/commonTypes';
|
||||||
import { Google } from 'iconsax-react';
|
import { Google } from 'iconsax-react';
|
||||||
|
import { Icon } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
export interface GoogleAuthenticationProps {
|
export interface GoogleAuthenticationProps {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
@@ -73,7 +74,7 @@ export const GoogleAuthentication = ({
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
loading={loginWithGoogleLoading}
|
loading={loginWithGoogleLoading}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
startIcon={<Google variant="Bold" />}
|
startIcon={<Icon Component={Google} variant="Bold" />}
|
||||||
>
|
>
|
||||||
{t('loginForm.loginWithGoogle')}
|
{t('loginForm.loginWithGoogle')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { Toast } from '@/components/Toast';
|
|||||||
import type { CountryCode, GUID } from '@/types/commonTypes';
|
import type { CountryCode, GUID } from '@/types/commonTypes';
|
||||||
import { GoogleAuthentication } from './GoogleAuthentication';
|
import { GoogleAuthentication } from './GoogleAuthentication';
|
||||||
import { isPhoneNumber } from '@/utils/regexes/isValidPhoneNumber';
|
import { isPhoneNumber } from '@/utils/regexes/isValidPhoneNumber';
|
||||||
|
import { useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
export interface LoginRegisterFormProps {
|
export interface LoginRegisterFormProps {
|
||||||
loginRegisterValue: string;
|
loginRegisterValue: string;
|
||||||
@@ -42,8 +43,8 @@ export function LoginRegisterForm({
|
|||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
const [error, setError] = useState<string>();
|
const [error, setError] = useState<string>();
|
||||||
const [touched, setTouched] = useState<boolean>(false);
|
const [touched, setTouched] = useState<boolean>(false);
|
||||||
const [errorMessage, setErrorMessage] = useState<string>();
|
|
||||||
const inputError: boolean = touched && !!error;
|
const inputError: boolean = touched && !!error;
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const newValue = event.target.value;
|
const newValue = event.target.value;
|
||||||
@@ -99,7 +100,10 @@ export function LoginRegisterForm({
|
|||||||
if (jsonResult.success) {
|
if (jsonResult.success) {
|
||||||
onLoginRegisterSubmit(loginRegisterValue, jsonResult.userStatus);
|
onLoginRegisterSubmit(loginRegisterValue, jsonResult.userStatus);
|
||||||
} else {
|
} else {
|
||||||
setErrorMessage(jsonResult.message);
|
toast({
|
||||||
|
message: jsonResult.message,
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
setCheckStatusLoading(false);
|
setCheckStatusLoading(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -112,14 +116,6 @@ export function LoginRegisterForm({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
color="error"
|
|
||||||
onClose={() => setErrorMessage(undefined)}
|
|
||||||
open={!!errorMessage}
|
|
||||||
>
|
|
||||||
{errorMessage}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
<Typography variant="h5">{t('loginForm.title')}</Typography>
|
<Typography variant="h5">{t('loginForm.title')}</Typography>
|
||||||
<Typography variant="body2" color="text.secondary">
|
<Typography variant="body2" color="text.secondary">
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
sendSmsOtp,
|
sendSmsOtp,
|
||||||
} from '../../api/authorizationAPI';
|
} from '../../api/authorizationAPI';
|
||||||
import type { CountryCode, GUID } from '@/types/commonTypes';
|
import type { CountryCode, GUID } from '@/types/commonTypes';
|
||||||
|
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
interface OtpVerifyFormProps {
|
interface OtpVerifyFormProps {
|
||||||
value: string;
|
value: string;
|
||||||
@@ -37,15 +38,14 @@ export function OtpVerifyForm({
|
|||||||
}: OtpVerifyFormProps) {
|
}: OtpVerifyFormProps) {
|
||||||
const [otpCode, setOtpCode] = useState<string>('');
|
const [otpCode, setOtpCode] = useState<string>('');
|
||||||
const [otpDigitInvalid, setOtpDigitInvalid] = useState<boolean>(false);
|
const [otpDigitInvalid, setOtpDigitInvalid] = useState<boolean>(false);
|
||||||
const [verifyStatus, setVerifyStatus] = useState<'success' | 'failed'>();
|
const [isStatusSuccess, setIsStatusSuccess] = useState<boolean>();
|
||||||
const [errorMessage, setErrorMessage] = useState<string>();
|
|
||||||
const [verifyStatusLoading, setVerifyStatusLoading] =
|
const [verifyStatusLoading, setVerifyStatusLoading] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [verifyAlertOpen, setVerifyAlertOpen] = useState<boolean>(false);
|
|
||||||
const { t } = useTranslation('authentication');
|
const { t } = useTranslation('authentication');
|
||||||
const [resendTimer, setResendTimer] = useState<number>(120);
|
const [resendTimer, setResendTimer] = useState<number>(120);
|
||||||
const [canResend, setCanResend] = useState(false);
|
const [canResend, setCanResend] = useState(false);
|
||||||
const [resendLoading, setResendLoading] = useState<boolean>(false);
|
const [resendLoading, setResendLoading] = useState<boolean>(false);
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let interval: NodeJS.Timeout;
|
let interval: NodeJS.Timeout;
|
||||||
@@ -102,23 +102,34 @@ export function OtpVerifyForm({
|
|||||||
const jsonRes = await result.json();
|
const jsonRes = await result.json();
|
||||||
|
|
||||||
if (jsonRes.success) {
|
if (jsonRes.success) {
|
||||||
setVerifyStatus('success');
|
setIsStatusSuccess(true);
|
||||||
|
|
||||||
if (jsonRes.registeredWithOutPhoneNumber) {
|
if (jsonRes.registeredWithOutPhoneNumber) {
|
||||||
onVerifyPhoneNumber(jsonRes.userId);
|
onVerifyPhoneNumber(jsonRes.userId);
|
||||||
} else {
|
} else {
|
||||||
onOTPVerified(jsonRes.userId);
|
onOTPVerified(jsonRes.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toast({
|
||||||
|
message:
|
||||||
|
authMode === 'login'
|
||||||
|
? t('verify.youHaveSuccessfullyLoggedIn')
|
||||||
|
: t('verify.youHaveSuccessfullySignedIn'),
|
||||||
|
severity: 'success',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setVerifyStatus('failed');
|
setIsStatusSuccess(false);
|
||||||
setErrorMessage(jsonRes.message);
|
|
||||||
|
toast({
|
||||||
|
message: jsonRes.message,
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setVerifyAlertOpen(true);
|
|
||||||
setVerifyStatusLoading(false);
|
setVerifyStatusLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const otpMessage = (): string => {
|
const otpMessageFn = (): string => {
|
||||||
if (authType === 'phone' && authMode === 'login') {
|
if (authType === 'phone' && authMode === 'login') {
|
||||||
return t(
|
return t(
|
||||||
'verify.a4DigitVerificationCodeHasBeenSentToYourBobileNumberPleaseEnterIt',
|
'verify.a4DigitVerificationCodeHasBeenSentToYourBobileNumberPleaseEnterIt',
|
||||||
@@ -140,26 +151,11 @@ export function OtpVerifyForm({
|
|||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const toastMessage =
|
const otpMessage = otpMessageFn();
|
||||||
verifyStatus === 'failed'
|
|
||||||
? (errorMessage ?? t('verify.theVerificationCodeIsIncorrect'))
|
|
||||||
: verifyStatus === 'success' && authMode === 'register'
|
|
||||||
? t('verify.youHaveSuccessfullySignedIn')
|
|
||||||
: verifyStatus === 'success' && authMode === 'login'
|
|
||||||
? t('verify.youHaveSuccessfullyLoggedIn')
|
|
||||||
: '';
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack alignItems="center">
|
<Stack alignItems="center">
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
open={verifyAlertOpen}
|
|
||||||
onClose={() => setVerifyAlertOpen(false)}
|
|
||||||
color={verifyStatus === 'failed' ? 'error' : 'success'}
|
|
||||||
>
|
|
||||||
{toastMessage}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -176,7 +172,7 @@ export function OtpVerifyForm({
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="large"
|
size="large"
|
||||||
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
||||||
endIcon={<Edit2 />}
|
endIcon={<Icon Component={Edit2} />}
|
||||||
onClick={onEditValue}
|
onClick={onEditValue}
|
||||||
>
|
>
|
||||||
{authType === 'phone' ? countryCode + value : value}
|
{authType === 'phone' ? countryCode + value : value}
|
||||||
@@ -184,12 +180,12 @@ export function OtpVerifyForm({
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Typography variant="body2" color="textSecondary" sx={{ mt: 1 }}>
|
<Typography variant="body2" color="textSecondary" sx={{ mt: 1 }}>
|
||||||
{otpMessage()}
|
{otpMessage}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<DigitInput
|
<DigitInput
|
||||||
error={otpDigitInvalid || verifyStatus === 'failed'}
|
error={otpDigitInvalid || isStatusSuccess === false}
|
||||||
success={verifyStatus === 'success'}
|
success={isStatusSuccess === true}
|
||||||
onChange={(value) => setOtpCode(value)}
|
onChange={(value) => setOtpCode(value)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { AuthenticationCard } from '../AuthenticationCard';
|
|||||||
import type { ConfirmSmsOtpRequest } from '../../types/userTypes';
|
import type { ConfirmSmsOtpRequest } from '../../types/userTypes';
|
||||||
import { confirmSmsOtp, sendSmsOtp } from '../../api/authorizationAPI';
|
import { confirmSmsOtp, sendSmsOtp } from '../../api/authorizationAPI';
|
||||||
import type { CountryCode } from '@/types/commonTypes';
|
import type { CountryCode } from '@/types/commonTypes';
|
||||||
|
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
interface VerifyPhoneNumberProps {
|
interface VerifyPhoneNumberProps {
|
||||||
value: string;
|
value: string;
|
||||||
@@ -24,15 +25,14 @@ export function VerifyPhoneNumber({
|
|||||||
}: VerifyPhoneNumberProps) {
|
}: VerifyPhoneNumberProps) {
|
||||||
const [otpCode, setOtpCode] = useState<string>('');
|
const [otpCode, setOtpCode] = useState<string>('');
|
||||||
const [otpDigitInvalid, setOtpDigitInvalid] = useState<boolean>(false);
|
const [otpDigitInvalid, setOtpDigitInvalid] = useState<boolean>(false);
|
||||||
const [verifyStatus, setVerifyStatus] = useState<'success' | 'failed'>();
|
const [isStatusSuccess, setIsStatusSuccess] = useState<boolean>();
|
||||||
const [errorMessage, setErrorMessage] = useState<string>();
|
|
||||||
const [verifyStatusLoading, setVerifyStatusLoading] =
|
const [verifyStatusLoading, setVerifyStatusLoading] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [verifyAlertOpen, setVerifyAlertOpen] = useState<boolean>(false);
|
|
||||||
const { t } = useTranslation('authentication');
|
const { t } = useTranslation('authentication');
|
||||||
const [resendTimer, setResendTimer] = useState<number>(120);
|
const [resendTimer, setResendTimer] = useState<number>(120);
|
||||||
const [canResend, setCanResend] = useState(false);
|
const [canResend, setCanResend] = useState(false);
|
||||||
const [resendLoading, setResendLoading] = useState<boolean>(false);
|
const [resendLoading, setResendLoading] = useState<boolean>(false);
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let interval: NodeJS.Timeout;
|
let interval: NodeJS.Timeout;
|
||||||
@@ -78,37 +78,27 @@ export function VerifyPhoneNumber({
|
|||||||
const jsonRes = await result.json();
|
const jsonRes = await result.json();
|
||||||
|
|
||||||
if (jsonRes.success) {
|
if (jsonRes.success) {
|
||||||
setVerifyStatus('success');
|
setIsStatusSuccess(true);
|
||||||
|
toast({
|
||||||
|
message: t('verify.youHaveSuccessfullyLoggedIn'),
|
||||||
|
severity: 'success',
|
||||||
|
});
|
||||||
onPhoneNumberVerified();
|
onPhoneNumberVerified();
|
||||||
} else {
|
} else {
|
||||||
setVerifyStatus('failed');
|
setIsStatusSuccess(false);
|
||||||
setErrorMessage(jsonRes.message);
|
toast({
|
||||||
|
message:
|
||||||
|
jsonRes.message ?? t('verify.theVerificationCodeIsIncorrect'),
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setVerifyAlertOpen(true);
|
|
||||||
setVerifyStatusLoading(false);
|
setVerifyStatusLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const verifyAlertMessage = (): string => {
|
|
||||||
if (verifyStatus === 'failed') {
|
|
||||||
return errorMessage ?? t('verify.theVerificationCodeIsIncorrect');
|
|
||||||
} else {
|
|
||||||
return t('verify.youHaveSuccessfullyLoggedIn');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack alignItems="center">
|
<Stack alignItems="center">
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
open={verifyAlertOpen}
|
|
||||||
onClose={() => setVerifyAlertOpen(false)}
|
|
||||||
color={verifyStatus === 'failed' ? 'error' : 'success'}
|
|
||||||
>
|
|
||||||
{verifyAlertMessage()}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -125,7 +115,7 @@ export function VerifyPhoneNumber({
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="large"
|
size="large"
|
||||||
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
||||||
endIcon={<Edit2 />}
|
endIcon={<Icon Component={Edit2} />}
|
||||||
onClick={onEditValue}
|
onClick={onEditValue}
|
||||||
>
|
>
|
||||||
{countryCode + value}
|
{countryCode + value}
|
||||||
@@ -139,8 +129,8 @@ export function VerifyPhoneNumber({
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<DigitInput
|
<DigitInput
|
||||||
error={otpDigitInvalid || verifyStatus === 'failed'}
|
error={otpDigitInvalid || isStatusSuccess === false}
|
||||||
success={verifyStatus === 'success'}
|
success={isStatusSuccess === true}
|
||||||
onChange={(value) => setOtpCode(value)}
|
onChange={(value) => setOtpCode(value)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import ReactCountryFlag from 'react-country-flag';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { countries, type Country } from '../../../countries';
|
import { countries, type Country } from '../../../countries';
|
||||||
import type { CountryCode } from '@/types/commonTypes';
|
import type { CountryCode } from '@/types/commonTypes';
|
||||||
|
import { Icon } from '@rkheftan/harmony-ui';
|
||||||
interface CountryCodeSelectorProps {
|
interface CountryCodeSelectorProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
value: CountryCode;
|
value: CountryCode;
|
||||||
@@ -114,7 +115,7 @@ export function CountryCodeSelector({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* This inner Box prevents the content from being squeezed during the transition */}
|
{/* This inner Box prevents the content from being squeezed during the transition */}
|
||||||
<ArrowDown2 size="24" variant="Bold" />
|
<Icon Component={ArrowDown2} size="medium" variant="Bold" />
|
||||||
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="body1"
|
variant="body1"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import type { ResetPasswordRequest } from '../../types/userTypes';
|
|||||||
import type { AuthType } from '../../types/authTypes';
|
import type { AuthType } from '../../types/authTypes';
|
||||||
import type { CountryCode } from '@/types/commonTypes';
|
import type { CountryCode } from '@/types/commonTypes';
|
||||||
import { resetPassword } from '../../api/authorizationAPI';
|
import { resetPassword } from '../../api/authorizationAPI';
|
||||||
|
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
export interface ChangePasswordProps {
|
export interface ChangePasswordProps {
|
||||||
onEditInfo: () => void;
|
onEditInfo: () => void;
|
||||||
@@ -50,13 +51,7 @@ export const ChangePassword = ({
|
|||||||
const confirmInputRef = useRef<HTMLInputElement>(null);
|
const confirmInputRef = useRef<HTMLInputElement>(null);
|
||||||
const [changePasswordLoading, setChangePasswordLoading] =
|
const [changePasswordLoading, setChangePasswordLoading] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [changePasswordStatus, setChangePasswordStatus] = useState<
|
const toast = useToast();
|
||||||
'success' | 'failed'
|
|
||||||
>();
|
|
||||||
const [changePassAlertOpen, setChangePassAlertOpen] =
|
|
||||||
useState<boolean>(false);
|
|
||||||
const [changePassFailedMessage, setChangePassFailedMessage] =
|
|
||||||
useState<string>('');
|
|
||||||
|
|
||||||
const passwordValidationRules = [
|
const passwordValidationRules = [
|
||||||
{ title: t('forgetPassword.includingANumber'), validator: containsNumber },
|
{ title: t('forgetPassword.includingANumber'), validator: containsNumber },
|
||||||
@@ -100,13 +95,17 @@ export const ChangePassword = ({
|
|||||||
const jsonRes = await result.json();
|
const jsonRes = await result.json();
|
||||||
|
|
||||||
if (jsonRes.success) {
|
if (jsonRes.success) {
|
||||||
setChangePasswordStatus('success');
|
|
||||||
onPasswordChanged();
|
onPasswordChanged();
|
||||||
|
toast({
|
||||||
|
message: t('forgetPassword.passwordChangedSuccessfully'),
|
||||||
|
severity: 'success',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setChangePasswordStatus('failed');
|
toast({
|
||||||
setChangePassFailedMessage(jsonRes.message);
|
message: jsonRes.message,
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
setChangePassAlertOpen(true);
|
|
||||||
|
|
||||||
setChangePasswordLoading(false);
|
setChangePasswordLoading(false);
|
||||||
}
|
}
|
||||||
@@ -123,16 +122,6 @@ export const ChangePassword = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
open={changePassAlertOpen}
|
|
||||||
onClose={() => setChangePassAlertOpen(false)}
|
|
||||||
color={changePasswordStatus === 'failed' ? 'error' : 'success'}
|
|
||||||
>
|
|
||||||
{changePasswordStatus === 'failed'
|
|
||||||
? changePassFailedMessage
|
|
||||||
: t('forgetPassword.passwordChangedSuccessfully')}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -151,7 +140,7 @@ export const ChangePassword = ({
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="large"
|
size="large"
|
||||||
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
||||||
endIcon={<Edit2 />}
|
endIcon={<Icon Component={Edit2} />}
|
||||||
onClick={onEditInfo}
|
onClick={onEditInfo}
|
||||||
>
|
>
|
||||||
{forgettedPasswordInfo}
|
{forgettedPasswordInfo}
|
||||||
@@ -177,14 +166,22 @@ export const ChangePassword = ({
|
|||||||
startAdornment: confirmPassValue &&
|
startAdornment: confirmPassValue &&
|
||||||
isValidPassword(passValue) &&
|
isValidPassword(passValue) &&
|
||||||
passValue === confirmPassValue && (
|
passValue === confirmPassValue && (
|
||||||
<TickCircle variant="Bold" color={theme.palette.success.main} />
|
<Icon
|
||||||
|
Component={TickCircle}
|
||||||
|
variant="Bold"
|
||||||
|
color="success.main"
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
endAdornment: passValue ? (
|
endAdornment: passValue ? (
|
||||||
<IconButton
|
<IconButton
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => setShowPassword(!showPassword)}
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
>
|
>
|
||||||
{showPassword ? <Eye /> : <EyeSlash />}
|
{showPassword ? (
|
||||||
|
<Icon Component={Eye} />
|
||||||
|
) : (
|
||||||
|
<Icon Component={EyeSlash} />
|
||||||
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
) : (
|
) : (
|
||||||
''
|
''
|
||||||
@@ -198,12 +195,11 @@ export const ChangePassword = ({
|
|||||||
<Stack spacing={1} sx={{ mt: 2 }}>
|
<Stack spacing={1} sx={{ mt: 2 }}>
|
||||||
{passwordValidationRules.map((rule) => (
|
{passwordValidationRules.map((rule) => (
|
||||||
<Stack direction="row" spacing={1} sx={{ alignItems: 'center' }}>
|
<Stack direction="row" spacing={1} sx={{ alignItems: 'center' }}>
|
||||||
<TickCircle
|
<Icon
|
||||||
|
Component={TickCircle}
|
||||||
variant={rule.validator(passValue) ? 'Bold' : 'Linear'}
|
variant={rule.validator(passValue) ? 'Bold' : 'Linear'}
|
||||||
color={
|
color={
|
||||||
rule.validator(passValue)
|
rule.validator(passValue) ? 'success.main' : 'primary.light'
|
||||||
? theme.palette.success.main
|
|
||||||
: theme.palette.primary.light
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -227,14 +223,22 @@ export const ChangePassword = ({
|
|||||||
startAdornment: confirmPassValue &&
|
startAdornment: confirmPassValue &&
|
||||||
isValidPassword(passValue) &&
|
isValidPassword(passValue) &&
|
||||||
passValue === confirmPassValue && (
|
passValue === confirmPassValue && (
|
||||||
<TickCircle variant="Bold" color={theme.palette.success.main} />
|
<Icon
|
||||||
|
Component={TickCircle}
|
||||||
|
variant="Bold"
|
||||||
|
color="success.main"
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
endAdornment: confirmPassValue ? (
|
endAdornment: confirmPassValue ? (
|
||||||
<IconButton
|
<IconButton
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
|
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
|
||||||
>
|
>
|
||||||
{showConfirmPassword ? <Eye /> : <EyeSlash />}
|
{showConfirmPassword ? (
|
||||||
|
<Icon Component={Eye} />
|
||||||
|
) : (
|
||||||
|
<Icon Component={EyeSlash} />
|
||||||
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
) : (
|
) : (
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import { ForgettedPasswordInfo } from './ForgettedPasswordInfo';
|
|||||||
import { ForgetPasswordOtp } from './ForgetPasswordOtp';
|
import { ForgetPasswordOtp } from './ForgetPasswordOtp';
|
||||||
import { ChangePassword } from './ChangePassword';
|
import { ChangePassword } from './ChangePassword';
|
||||||
import type { CountryCode } from '@/types/commonTypes';
|
import type { CountryCode } from '@/types/commonTypes';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
export const ForgetPasswordContainer = () => {
|
export const ForgetPasswordContainer = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
const [forgetPassCurrentStep, setForgetPassCurrentStep] = useState<
|
const [forgetPassCurrentStep, setForgetPassCurrentStep] = useState<
|
||||||
'enterInfo' | 'verifyOtp' | 'setPassword'
|
'enterInfo' | 'verifyOtp' | 'setPassword'
|
||||||
>('enterInfo');
|
>('enterInfo');
|
||||||
@@ -27,7 +29,7 @@ export const ForgetPasswordContainer = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handlePasswordChanged = () => {
|
const handlePasswordChanged = () => {
|
||||||
console.log('changingPasswordTo');
|
navigate('/login');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -6,9 +6,16 @@ import type { AuthType } from '../../types/authTypes';
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Toast } from '@/components/Toast';
|
import { Toast } from '@/components/Toast';
|
||||||
import { AuthenticationCard } from '../AuthenticationCard';
|
import { AuthenticationCard } from '../AuthenticationCard';
|
||||||
import type { ConfirmForgetPassCodeRequest } from '../../types/userTypes';
|
import type {
|
||||||
|
ConfirmForgetPassCodeRequest,
|
||||||
|
SendForgetPassCodeRequest,
|
||||||
|
} from '../../types/userTypes';
|
||||||
import type { CountryCode } from '@/types/commonTypes';
|
import type { CountryCode } from '@/types/commonTypes';
|
||||||
import { confirmForgetPassCode } from '../../api/authorizationAPI';
|
import {
|
||||||
|
confirmForgetPassCode,
|
||||||
|
sendForgetPassCode,
|
||||||
|
} from '../../api/authorizationAPI';
|
||||||
|
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
interface ForgetPasswordOtpProps {
|
interface ForgetPasswordOtpProps {
|
||||||
forgettedPasswordInfo: string;
|
forgettedPasswordInfo: string;
|
||||||
@@ -27,14 +34,14 @@ export function ForgetPasswordOtp({
|
|||||||
}: ForgetPasswordOtpProps) {
|
}: ForgetPasswordOtpProps) {
|
||||||
const [otpCode, setOtpCode] = useState<string>('');
|
const [otpCode, setOtpCode] = useState<string>('');
|
||||||
const [otpDigitInvalid, setOtpDigitInvalid] = useState<boolean>(false);
|
const [otpDigitInvalid, setOtpDigitInvalid] = useState<boolean>(false);
|
||||||
const [verifyStatus, setVerifyStatus] = useState<'failed' | 'success'>();
|
const [isStatusSuccess, setIsStatusSuccess] = useState<boolean>();
|
||||||
const [verifyStatusLoading, setVerifyStatusLoading] =
|
const [verifyStatusLoading, setVerifyStatusLoading] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
const [verifyAlertMessage, setVerifyAlertMessage] = useState<string>();
|
|
||||||
const { t } = useTranslation('authentication');
|
const { t } = useTranslation('authentication');
|
||||||
const [resendTimer, setResendTimer] = useState<number>(120);
|
const [resendTimer, setResendTimer] = useState<number>(120);
|
||||||
const [canResend, setCanResend] = useState(false);
|
const [canResend, setCanResend] = useState(false);
|
||||||
const [resendLoading, setResendLoading] = useState<boolean>(false);
|
const [resendLoading, setResendLoading] = useState<boolean>(false);
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let interval: NodeJS.Timeout;
|
let interval: NodeJS.Timeout;
|
||||||
@@ -49,18 +56,19 @@ export function ForgetPasswordOtp({
|
|||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [resendTimer]);
|
}, [resendTimer]);
|
||||||
|
|
||||||
const handleResendOTPCode = () => {
|
const handleResendOTPCode = async () => {
|
||||||
setResendLoading(true);
|
setResendLoading(true);
|
||||||
|
|
||||||
// TODO: Call API here instead of settimeout
|
const sendCodeRequest: SendForgetPassCodeRequest = {
|
||||||
|
email: infoType === 'email' ? forgettedPasswordInfo : undefined,
|
||||||
|
phoneNumber:
|
||||||
|
infoType === 'phone' ? countryCode + forgettedPasswordInfo : undefined,
|
||||||
|
};
|
||||||
|
const result = await sendForgetPassCode(sendCodeRequest);
|
||||||
|
|
||||||
setTimeout(() => {
|
setResendTimer(120);
|
||||||
console.log('resended');
|
setCanResend(false);
|
||||||
|
setResendLoading(false);
|
||||||
setResendTimer(120);
|
|
||||||
setCanResend(false);
|
|
||||||
setResendLoading(false);
|
|
||||||
}, 1000);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatTime = (seconds: number) => {
|
const formatTime = (seconds: number) => {
|
||||||
@@ -90,11 +98,14 @@ export function ForgetPasswordOtp({
|
|||||||
const jsonRes = await result.json();
|
const jsonRes = await result.json();
|
||||||
|
|
||||||
if (jsonRes.success) {
|
if (jsonRes.success) {
|
||||||
setVerifyStatus('success');
|
setIsStatusSuccess(true);
|
||||||
onOTPVerified(otpCode);
|
onOTPVerified(otpCode);
|
||||||
} else {
|
} else {
|
||||||
setVerifyStatus('failed');
|
setIsStatusSuccess(false);
|
||||||
setVerifyAlertMessage(jsonRes.message);
|
toast({
|
||||||
|
message: jsonRes.message,
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setVerifyStatusLoading(false);
|
setVerifyStatusLoading(false);
|
||||||
@@ -104,14 +115,6 @@ export function ForgetPasswordOtp({
|
|||||||
return (
|
return (
|
||||||
<Stack alignItems="center">
|
<Stack alignItems="center">
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
open={!!verifyAlertMessage}
|
|
||||||
onClose={() => setVerifyAlertMessage(undefined)}
|
|
||||||
color={'error'}
|
|
||||||
>
|
|
||||||
{verifyAlertMessage}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@@ -130,7 +133,7 @@ export function ForgetPasswordOtp({
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
size="large"
|
size="large"
|
||||||
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
sx={{ textTransform: 'lowercase', width: 'auto' }}
|
||||||
endIcon={<Edit2 />}
|
endIcon={<Icon Component={Edit2} />}
|
||||||
onClick={onEditInfo}
|
onClick={onEditInfo}
|
||||||
>
|
>
|
||||||
{infoType === 'phone'
|
{infoType === 'phone'
|
||||||
@@ -150,8 +153,8 @@ export function ForgetPasswordOtp({
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<DigitInput
|
<DigitInput
|
||||||
error={otpDigitInvalid || verifyStatus === 'failed'}
|
error={otpDigitInvalid || isStatusSuccess === false}
|
||||||
success={verifyStatus === 'success'}
|
success={isStatusSuccess === true}
|
||||||
onChange={(value) => setOtpCode(value)}
|
onChange={(value) => setOtpCode(value)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { sendForgetPassCode } from '../../api/authorizationAPI';
|
|||||||
import type { SendForgetPassCodeRequest } from '../../types/userTypes';
|
import type { SendForgetPassCodeRequest } from '../../types/userTypes';
|
||||||
import { Toast } from '@/components/Toast';
|
import { Toast } from '@/components/Toast';
|
||||||
import { isPhoneNumber } from '@/utils/regexes/isValidPhoneNumber';
|
import { isPhoneNumber } from '@/utils/regexes/isValidPhoneNumber';
|
||||||
|
import { useToast } from '@rkheftan/harmony-ui';
|
||||||
|
|
||||||
export interface ForgettedPasswordInfoProps {
|
export interface ForgettedPasswordInfoProps {
|
||||||
forgettedPasswordInfo: string;
|
forgettedPasswordInfo: string;
|
||||||
@@ -36,9 +37,9 @@ export function ForgettedPasswordInfo({
|
|||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
const [error, setError] = useState<string>();
|
const [error, setError] = useState<string>();
|
||||||
const [touched, setTouched] = useState<boolean>(false);
|
const [touched, setTouched] = useState<boolean>(false);
|
||||||
const [errorMessage, setErrorMessage] = useState<string>();
|
|
||||||
const [sendCodeLoading, setSendCodeLoading] = useState<boolean>(false);
|
const [sendCodeLoading, setSendCodeLoading] = useState<boolean>(false);
|
||||||
const inputError: boolean = touched && !!error;
|
const inputError: boolean = touched && !!error;
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const newValue = event.target.value;
|
const newValue = event.target.value;
|
||||||
@@ -92,7 +93,10 @@ export function ForgettedPasswordInfo({
|
|||||||
const jsonRes = await result.json();
|
const jsonRes = await result.json();
|
||||||
|
|
||||||
if (!jsonRes.success) {
|
if (!jsonRes.success) {
|
||||||
setErrorMessage(jsonRes.message);
|
toast({
|
||||||
|
message: jsonRes.message,
|
||||||
|
severity: 'error',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setSendCodeLoading(false);
|
setSendCodeLoading(false);
|
||||||
@@ -108,14 +112,6 @@ export function ForgettedPasswordInfo({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthenticationCard>
|
<AuthenticationCard>
|
||||||
<Toast
|
|
||||||
color="error"
|
|
||||||
onClose={() => setErrorMessage(undefined)}
|
|
||||||
open={!!errorMessage}
|
|
||||||
>
|
|
||||||
{errorMessage}
|
|
||||||
</Toast>
|
|
||||||
|
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
<Typography variant="h5">
|
<Typography variant="h5">
|
||||||
{t('forgetPassword.forgetPassword')}
|
{t('forgetPassword.forgetPassword')}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './routes/AuthenticationPage';
|
||||||
|
export * from './routes/ForgetPasswordPage';
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { Layout } from '@/components/Layout/Layout';
|
import { Layout } from '@/components/Layout/Layout';
|
||||||
|
import {
|
||||||
|
AuthenticationPage,
|
||||||
|
ForgetPasswordPage,
|
||||||
|
} from '@/features/authorization';
|
||||||
import {
|
import {
|
||||||
Calendar,
|
Calendar,
|
||||||
Devices,
|
Devices,
|
||||||
@@ -27,6 +31,18 @@ export interface RouteConfig {
|
|||||||
|
|
||||||
// can lazy load component if needed (ex. lazy(() => import('@/features/home/routes/HomePage'));)
|
// can lazy load component if needed (ex. lazy(() => import('@/features/home/routes/HomePage'));)
|
||||||
export const appRoutes: RouteConfig[] = [
|
export const appRoutes: RouteConfig[] = [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
element: <Navigate to="/setting/profile" replace />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/login',
|
||||||
|
element: <AuthenticationPage />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/forget-password',
|
||||||
|
element: <ForgetPasswordPage />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
element: <Navigate to="/setting/profile" replace />,
|
element: <Navigate to="/setting/profile" replace />,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { Palette } from './color.type';
|
|||||||
export const PALETTE: Palette = {
|
export const PALETTE: Palette = {
|
||||||
primary: {
|
primary: {
|
||||||
light: {
|
light: {
|
||||||
main: blue[400],
|
main: blue.A400,
|
||||||
dark: blue[700],
|
dark: blue[700],
|
||||||
light: blue[100],
|
light: blue[100],
|
||||||
contrastText: '#FFFFFF',
|
contrastText: '#FFFFFF',
|
||||||
|
|||||||
Reference in New Issue
Block a user