mirror of
https://github.com/ente-io/ente.git
synced 2025-08-09 07:48:52 +00:00
Conv
This commit is contained in:
parent
ad5cad8e97
commit
17dd67afc0
@ -1,13 +1,14 @@
|
|||||||
import { PAGES } from "@/accounts/constants/pages";
|
|
||||||
import { sendOTT } from "@/accounts/services/user";
|
|
||||||
import {
|
import {
|
||||||
FormPaper,
|
AccountsPageContents,
|
||||||
FormPaperFooter,
|
AccountsPageFooter,
|
||||||
FormPaperTitle,
|
AccountsPageTitle,
|
||||||
} from "@/base/components/FormPaper";
|
} from "@/accounts/components/layouts/centered-paper";
|
||||||
|
import { PAGES } from "@/accounts/constants/pages";
|
||||||
|
import { appHomeRoute, stashRedirect } from "@/accounts/services/redirect";
|
||||||
|
import { sendOTT } from "@/accounts/services/user";
|
||||||
|
import type { PageProps } from "@/accounts/types/page";
|
||||||
import { sharedCryptoWorker } from "@/base/crypto";
|
import { sharedCryptoWorker } from "@/base/crypto";
|
||||||
import log from "@/base/log";
|
import log from "@/base/log";
|
||||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
|
||||||
import LinkButton from "@ente/shared/components/LinkButton";
|
import LinkButton from "@ente/shared/components/LinkButton";
|
||||||
import SingleInputForm, {
|
import SingleInputForm, {
|
||||||
type SingleInputFormProps,
|
type SingleInputFormProps,
|
||||||
@ -22,8 +23,6 @@ import type { KeyAttributes, User } from "@ente/shared/user/types";
|
|||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { appHomeRoute, stashRedirect } from "../services/redirect";
|
|
||||||
import type { PageProps } from "../types/page";
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||||
const bip39 = require("bip39");
|
const bip39 = require("bip39");
|
||||||
@ -31,7 +30,7 @@ const bip39 = require("bip39");
|
|||||||
bip39.setDefaultWordlist("english");
|
bip39.setDefaultWordlist("english");
|
||||||
|
|
||||||
const Page: React.FC<PageProps> = ({ appContext }) => {
|
const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||||
const { showNavBar, showMiniDialog } = appContext;
|
const { showMiniDialog } = appContext;
|
||||||
|
|
||||||
const [keyAttributes, setKeyAttributes] = useState<
|
const [keyAttributes, setKeyAttributes] = useState<
|
||||||
KeyAttributes | undefined
|
KeyAttributes | undefined
|
||||||
@ -60,7 +59,6 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
|
|||||||
} else {
|
} else {
|
||||||
setKeyAttributes(keyAttributes);
|
setKeyAttributes(keyAttributes);
|
||||||
}
|
}
|
||||||
showNavBar(true);
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const recover: SingleInputFormProps["callback"] = async (
|
const recover: SingleInputFormProps["callback"] = async (
|
||||||
@ -108,26 +106,22 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VerticallyCentered>
|
<AccountsPageContents>
|
||||||
<FormPaper>
|
<AccountsPageTitle>{t("recover_account")}</AccountsPageTitle>
|
||||||
<FormPaperTitle>{t("recover_account")}</FormPaperTitle>
|
<SingleInputForm
|
||||||
<SingleInputForm
|
callback={recover}
|
||||||
callback={recover}
|
fieldType="text"
|
||||||
fieldType="text"
|
placeholder={t("recovery_key")}
|
||||||
placeholder={t("recovery_key")}
|
buttonText={t("recover")}
|
||||||
buttonText={t("recover")}
|
disableAutoComplete
|
||||||
disableAutoComplete
|
/>
|
||||||
/>
|
<AccountsPageFooter>
|
||||||
<FormPaperFooter>
|
<LinkButton onClick={showNoRecoveryKeyMessage}>
|
||||||
<LinkButton onClick={showNoRecoveryKeyMessage}>
|
{t("no_recovery_key_title")}
|
||||||
{t("no_recovery_key_title")}
|
</LinkButton>
|
||||||
</LinkButton>
|
<LinkButton onClick={router.back}>{t("go_back")}</LinkButton>
|
||||||
<LinkButton onClick={router.back}>
|
</AccountsPageFooter>
|
||||||
{t("go_back")}
|
</AccountsPageContents>
|
||||||
</LinkButton>
|
|
||||||
</FormPaperFooter>
|
|
||||||
</FormPaper>
|
|
||||||
</VerticallyCentered>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user