update two factor modal
This commit is contained in:
parent
427f0fae5c
commit
007336f83c
|
@ -3,10 +3,16 @@ import { getTwoFactorStatus } from 'services/userService';
|
||||||
import { SetLoading } from 'types/gallery';
|
import { SetLoading } from 'types/gallery';
|
||||||
import { getData, LS_KEYS, setData } from 'utils/storage/localStorage';
|
import { getData, LS_KEYS, setData } from 'utils/storage/localStorage';
|
||||||
import constants from 'utils/strings/constants';
|
import constants from 'utils/strings/constants';
|
||||||
import DialogBox from '../../DialogBox';
|
|
||||||
import TwoFactorModalSetupSection from './Setup';
|
import TwoFactorModalSetupSection from './Setup';
|
||||||
import TwoFactorModalManageSection from './Manage';
|
import TwoFactorModalManageSection from './Manage';
|
||||||
|
import { Dialog, DialogContent, styled } from '@mui/material';
|
||||||
|
import DialogTitleWithCloseButton from 'components/DialogBox/TitleWithCloseButton';
|
||||||
|
|
||||||
|
const TwoFactorDialog = styled(Dialog)(({ theme }) => ({
|
||||||
|
'& .MuiDialogContent-root': {
|
||||||
|
padding: theme.spacing(2, 4),
|
||||||
|
},
|
||||||
|
}));
|
||||||
interface Props {
|
interface Props {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
onHide: () => void;
|
onHide: () => void;
|
||||||
|
@ -41,22 +47,18 @@ function TwoFactorModal(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DialogBox
|
<TwoFactorDialog maxWidth="xs" open={props.show} onClose={props.onHide}>
|
||||||
size="xs"
|
<DialogTitleWithCloseButton onClose={props.onHide}>
|
||||||
fullWidth
|
{constants.TWO_FACTOR_AUTHENTICATION}
|
||||||
open={props.show}
|
</DialogTitleWithCloseButton>
|
||||||
onClose={props.onHide}
|
<DialogContent sx={{ px: 4 }}>
|
||||||
attributes={{
|
|
||||||
title: constants.TWO_FACTOR_AUTHENTICATION,
|
|
||||||
}}>
|
|
||||||
<>
|
|
||||||
{isTwoFactorEnabled ? (
|
{isTwoFactorEnabled ? (
|
||||||
<TwoFactorModalManageSection close={close} />
|
<TwoFactorModalManageSection close={close} />
|
||||||
) : (
|
) : (
|
||||||
<TwoFactorModalSetupSection close={close} />
|
<TwoFactorModalSetupSection close={close} />
|
||||||
)}
|
)}
|
||||||
</>
|
</DialogContent>
|
||||||
</DialogBox>
|
</TwoFactorDialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default TwoFactorModal;
|
export default TwoFactorModal;
|
||||||
|
|
Loading…
Reference in a new issue