π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Move
Manav Rathi2195c79fcc20
diff --git a/web/packages/accounts/components/two-factor/InvalidInputMessage.tsx b/web/packages/accounts/components/two-factor/InvalidInputMessage.tsxdeleted file mode 100644index ea3b5fdc51..0000000000--- a/web/packages/accounts/components/two-factor/InvalidInputMessage.tsx+++ /dev/null@@ -1,18 +0,0 @@-import { Typography, type TypographyProps } from "@mui/material";-import React from "react";--const InvalidInputMessage: React.FC<TypographyProps> = (props) => {- return (- <Typography- variant="mini"- sx={{- color: (theme) => theme.colors.danger.A700,- }}- {...props}- >- {props.children}- </Typography>- );-};--export default InvalidInputMessage;diff --git a/web/packages/accounts/components/two-factor/VerifyForm.tsx b/web/packages/accounts/components/two-factor/VerifyTwoFactor.tsxsimilarity index 90%rename from web/packages/accounts/components/two-factor/VerifyForm.tsxrename to web/packages/accounts/components/two-factor/VerifyTwoFactor.tsxindex 3a028cc980..78b6c3410c 100644--- a/web/packages/accounts/components/two-factor/VerifyForm.tsx+++ b/web/packages/accounts/components/two-factor/VerifyTwoFactor.tsx@@ -1,13 +1,12 @@-import InvalidInputMessage from "@/accounts/components/two-factor/InvalidInputMessage";import { LoadingButton } from "@/base/components/mui/LoadingButton";import {CenteredFlex,VerticallyCentered,} from "@ente/shared/components/Container";-import { Box, Typography, styled } from "@mui/material";+import { Box, Typography, styled, type TypographyProps } from "@mui/material";import { Formik, type FormikHelpers } from "formik";import { t } from "i18next";-import { useState } from "react";+import React, { useState } from "react";import OtpInput from "react-otp-input";interface formValues {@@ -23,7 +22,7 @@ export type VerifyTwoFactorCallback = (markSuccessful: () => void,) => Promise<void>;-export default function VerifyTwoFactor(props: Props) {+export function VerifyTwoFactor(props: Props) {const [waiting, setWaiting] = useState(false);const [shouldAutoFocus, setShouldAutoFocus] = useState(true);@@ -128,3 +127,17 @@ const IndividualInput = styled("input")(}`,);++const InvalidInputMessage: React.FC<TypographyProps> = (props) => {+ return (+ <Typography+ variant="mini"+ sx={{+ color: (theme) => theme.colors.danger.A700,+ }}+ {...props}+ >+ {props.children}+ </Typography>+ );+};diff --git a/web/packages/accounts/pages/two-factor/setup.tsx b/web/packages/accounts/pages/two-factor/setup.tsxindex 0e6fbce450..a77692439d 100644--- a/web/packages/accounts/pages/two-factor/setup.tsx+++ b/web/packages/accounts/pages/two-factor/setup.tsx@@ -9,9 +9,10 @@ import { t } from "i18next";import { useRouter } from "next/router";import { useEffect, useState } from "react";import { TwoFactorSetup } from "../../components/two-factor/TwoFactorSetup";-import VerifyTwoFactor, {+import {+ VerifyTwoFactor,type VerifyTwoFactorCallback,-} from "../../components/two-factor/VerifyForm";+} from "../../components/two-factor/VerifyTwoFactor";import { appHomeRoute } from "../../services/redirect";import type { TwoFactorSecret } from "../../services/user";import { enableTwoFactor, setupTwoFactor } from "../../services/user";diff --git a/web/packages/accounts/pages/two-factor/verify.tsx b/web/packages/accounts/pages/two-factor/verify.tsxindex 86e1bea901..6f09d153c5 100644--- a/web/packages/accounts/pages/two-factor/verify.tsx+++ b/web/packages/accounts/pages/two-factor/verify.tsx@@ -1,6 +1,3 @@-import VerifyTwoFactor, {- type VerifyTwoFactorCallback,-} from "@/accounts/components/two-factor/VerifyForm";import { PAGES } from "@/accounts/constants/pages";import { verifyTwoFactor } from "@/accounts/services/user";import {@@ -22,6 +19,10 @@ import { HttpStatusCode } from "axios";import { t } from "i18next";import { useRouter } from "next/router";import { useEffect, useState } from "react";+import {+ VerifyTwoFactor,+ type VerifyTwoFactorCallback,+} from "../../components/two-factor/VerifyTwoFactor";import { unstashRedirect } from "../../services/redirect";import type { PageProps } from "../../types/page";