From bd35f3e43d3e43598aded81ae29348988a4010a7 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 4 Nov 2024 14:05:24 +0530 Subject: [PATCH] Rename --- .../src/components/Sidebar/TwoFactorModal.tsx | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/web/apps/photos/src/components/Sidebar/TwoFactorModal.tsx b/web/apps/photos/src/components/Sidebar/TwoFactorModal.tsx index 3a5972710f..d15ed0f06f 100644 --- a/web/apps/photos/src/components/Sidebar/TwoFactorModal.tsx +++ b/web/apps/photos/src/components/Sidebar/TwoFactorModal.tsx @@ -1,5 +1,5 @@ import { disableTwoFactor } from "@/accounts/api/user"; -import type { ModalVisibilityProps } from "@/base/components/utils/modal"; +import type { ModalVisibilityProps, NestedDrawerVisibilityProps } from "@/base/components/utils/modal"; import { AppContext } from "@/new/photos/types/context"; import { VerticallyCentered } from "@ente/shared/components/Container"; import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton"; @@ -25,11 +25,15 @@ const TwoFactorDialog = styled(Dialog)(({ theme }) => ({ }, })); -type TwoFactorModalProps = ModalVisibilityProps & { - closeSidebar: () => void; -}; +// type TwoFactorModalProps = ModalVisibilityProps & { +// closeSidebar: () => void; +// }; -function TwoFactorModal(props: TwoFactorModalProps) { +export const TwoFactorSettings: React.FC = ({ + open, + onClose, + onRootClose: closeSidebar, +}) => { const [isTwoFactorEnabled, setTwoFactorStatus] = useState(false); useEffect(() => { @@ -39,7 +43,7 @@ function TwoFactorModal(props: TwoFactorModalProps) { }, []); useEffect(() => { - if (!props.open) { + if (!open) { return; } const main = async () => { @@ -51,20 +55,20 @@ function TwoFactorModal(props: TwoFactorModalProps) { }); }; main(); - }, [props.open]); + }, [open]); const closeDialog = () => { - props.onClose(); - props.closeSidebar(); + onClose(); + closeSidebar(); }; return ( - + {t("TWO_FACTOR_AUTHENTICATION")} @@ -78,7 +82,7 @@ function TwoFactorModal(props: TwoFactorModalProps) { ); } -export default TwoFactorModal; +export default TwoFactorSettings; interface TwoFactorModalSetupSectionProps { closeDialog: () => void;