From 345c7068141520ca4d076fa2ff0248d3b5a156be Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sun, 26 May 2024 19:07:48 +0530 Subject: [PATCH] ce --- web/packages/accounts/pages/change-email.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/web/packages/accounts/pages/change-email.tsx b/web/packages/accounts/pages/change-email.tsx index 572f797de..073bef30e 100644 --- a/web/packages/accounts/pages/change-email.tsx +++ b/web/packages/accounts/pages/change-email.tsx @@ -2,7 +2,11 @@ import { ensure } from "@/utils/ensure"; import { wait } from "@/utils/promise"; import { changeEmail, sendOTTForEmailChange } from "@ente/accounts/api/user"; import { PAGES } from "@ente/accounts/constants/pages"; -import { APP_HOMES } from "@ente/shared/apps/constants"; +import { + APP_HOMES, + appNameToAppNameOld, + type APPS, +} from "@ente/shared/apps/constants"; import type { PageProps } from "@ente/shared/apps/types"; import { VerticallyCentered } from "@ente/shared/components/Container"; import FormPaper from "@ente/shared/components/Form/FormPaper"; @@ -19,7 +23,11 @@ import { useEffect, useState } from "react"; import { Trans } from "react-i18next"; import * as Yup from "yup"; -function ChangeEmailPage({ appName, appContext }: PageProps) { +const Page: React.FC = ({ appContext }) => { + const { appName } = appContext; + + const appNameOld = appNameToAppNameOld(appName); + const router = useRouter(); useEffect(() => { @@ -33,20 +41,20 @@ function ChangeEmailPage({ appName, appContext }: PageProps) { {t("CHANGE_EMAIL")} - + ); -} +}; -export default ChangeEmailPage; +export default Page; interface formValues { email: string; ott?: string; } -function ChangeEmailForm({ appName }: PageProps) { +function ChangeEmailForm({ appName }: { appName: APPS }) { const [loading, setLoading] = useState(false); const [ottInputVisible, setShowOttInputVisibility] = useState(false); const [email, setEmail] = useState(null);