diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx index caa3f708e8..6e0c22f7c4 100644 --- a/web/apps/photos/src/components/Sidebar/index.tsx +++ b/web/apps/photos/src/components/Sidebar/index.tsx @@ -432,6 +432,7 @@ const UtilitySection: React.FC = ({ closeSidebar }) => { setWatchFolderView, themeColor, setThemeColor, + showMiniDialog, } = appContext; const { show: showRecoveryKey, props: recoveryKeyVisibilityProps } = @@ -527,7 +528,10 @@ const UtilitySection: React.FC = ({ closeSidebar }) => { label={t("preferences")} /> - + = ({ appContext }) => { - const { logout } = appContext; + const { logout, showMiniDialog } = appContext; const [token, setToken] = useState(); const [user, setUser] = useState(); @@ -107,6 +107,7 @@ const Page: React.FC = ({ appContext }) => { setOpenRecoveryKey(false); router.push(appHomeRoute); }} + showMiniDialog={showMiniDialog} /> ) : ( diff --git a/web/packages/new/photos/components/RecoveryKey.tsx b/web/packages/new/photos/components/RecoveryKey.tsx index 17a1980bd8..dfdd1f20fb 100644 --- a/web/packages/new/photos/components/RecoveryKey.tsx +++ b/web/packages/new/photos/components/RecoveryKey.tsx @@ -1,9 +1,9 @@ +import { type MiniDialogAttributes } from "@/base/components/MiniDialog"; import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton"; import { errorDialogAttributes } from "@/base/components/utils/mini-dialog"; import type { ModalVisibilityProps } from "@/base/components/utils/modal"; import { useIsSmallWidth } from "@/base/hooks"; import log from "@/base/log"; -import { useAppContext } from "@/new/photos/types/context"; import { ensure } from "@/utils/ensure"; import CodeBlock from "@ente/shared/components/CodeBlock"; import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton"; @@ -24,12 +24,15 @@ import { downloadString } from "../utils/web"; // mobile client library only supports english. bip39.setDefaultWordlist("english"); -export const RecoveryKey: React.FC = ({ +type RecoveryKeyProps = ModalVisibilityProps & { + showMiniDialog: (attributes: MiniDialogAttributes) => void; +}; + +export const RecoveryKey: React.FC = ({ open, onClose, + showMiniDialog, }) => { - const { showMiniDialog } = useAppContext(); - const [recoveryKey, setRecoveryKey] = useState(); const fullScreen = useIsSmallWidth();