Refactor
This commit is contained in:
parent
55bdb070ce
commit
693ef45e2c
19 changed files with 73 additions and 88 deletions
8
web/apps/accounts/src/pages/credentials.tsx
Normal file
8
web/apps/accounts/src/pages/credentials.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/credentials";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,9 +0,0 @@
|
|||
import CredentialPage from "@ente/accounts/pages/credentials";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "../_app";
|
||||
|
||||
export default function Credential() {
|
||||
const appContext = useContext(AppContext);
|
||||
return <CredentialPage appContext={appContext} appName={APPS.ACCOUNTS} />;
|
||||
}
|
8
web/apps/accounts/src/pages/generate.tsx
Normal file
8
web/apps/accounts/src/pages/generate.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/generate";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,9 +0,0 @@
|
|||
import GeneratePage from "@ente/accounts/pages/generate";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function Generate() {
|
||||
const appContext = useContext(AppContext);
|
||||
return <GeneratePage appContext={appContext} appName={APPS.ACCOUNTS} />;
|
||||
}
|
8
web/apps/accounts/src/pages/login.tsx
Normal file
8
web/apps/accounts/src/pages/login.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/login";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,9 +0,0 @@
|
|||
import LoginPage from "@ente/accounts/pages/login";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "../_app";
|
||||
|
||||
export default function Login() {
|
||||
const appContext = useContext(AppContext);
|
||||
return <LoginPage appContext={appContext} appName={APPS.ACCOUNTS} />;
|
||||
}
|
8
web/apps/accounts/src/pages/recover.tsx
Normal file
8
web/apps/accounts/src/pages/recover.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/recover";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,9 +0,0 @@
|
|||
import RecoverPage from "@ente/accounts/pages/recover";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function Recover() {
|
||||
const appContext = useContext(AppContext);
|
||||
return <RecoverPage appContext={appContext} appName={APPS.ACCOUNTS} />;
|
||||
}
|
8
web/apps/accounts/src/pages/signup.tsx
Normal file
8
web/apps/accounts/src/pages/signup.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/signup";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,9 +0,0 @@
|
|||
import SignupPage from "@ente/accounts/pages/signup";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function Sigup() {
|
||||
const appContext = useContext(AppContext);
|
||||
return <SignupPage appContext={appContext} appName={APPS.ACCOUNTS} />;
|
||||
}
|
8
web/apps/accounts/src/pages/two-factor/recover.tsx
Normal file
8
web/apps/accounts/src/pages/two-factor/recover.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/two-factor/recover";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,11 +0,0 @@
|
|||
import TwoFactorRecoverPage from "@ente/accounts/pages/two-factor/recover";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function TwoFactorRecover() {
|
||||
const appContext = useContext(AppContext);
|
||||
return (
|
||||
<TwoFactorRecoverPage appContext={appContext} appName={APPS.ACCOUNTS} />
|
||||
);
|
||||
}
|
8
web/apps/accounts/src/pages/two-factor/setup.tsx
Normal file
8
web/apps/accounts/src/pages/two-factor/setup.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/two-factor/setup";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,11 +0,0 @@
|
|||
import TwoFactorSetupPage from "@ente/accounts/pages/two-factor/setup";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function TwoFactorSetup() {
|
||||
const appContext = useContext(AppContext);
|
||||
return (
|
||||
<TwoFactorSetupPage appContext={appContext} appName={APPS.ACCOUNTS} />
|
||||
);
|
||||
}
|
8
web/apps/accounts/src/pages/two-factor/verify.tsx
Normal file
8
web/apps/accounts/src/pages/two-factor/verify.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/two-factor/verify";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "../_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,11 +0,0 @@
|
|||
import TwoFactorVerifyPage from "@ente/accounts/pages/two-factor/verify";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function TwoFactorVerify() {
|
||||
const appContext = useContext(AppContext);
|
||||
return (
|
||||
<TwoFactorVerifyPage appContext={appContext} appName={APPS.ACCOUNTS} />
|
||||
);
|
||||
}
|
8
web/apps/accounts/src/pages/verify.tsx
Normal file
8
web/apps/accounts/src/pages/verify.tsx
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { ensure } from "@/utils/ensure";
|
||||
import Page_ from "@ente/accounts/pages/verify";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "./_app";
|
||||
|
||||
const Page = () => <Page_ appContext={ensure(useContext(AppContext))} />;
|
||||
|
||||
export default Page;
|
|
@ -1,9 +0,0 @@
|
|||
import VerifyPage from "@ente/accounts/pages/verify";
|
||||
import { APPS } from "@ente/shared/apps/constants";
|
||||
import { AppContext } from "pages/_app";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function Verify() {
|
||||
const appContext = useContext(AppContext);
|
||||
return <VerifyPage appContext={appContext} appName={APPS.ACCOUNTS} />;
|
||||
}
|
|
@ -4,6 +4,6 @@ import { APPS } from "./constants";
|
|||
|
||||
export interface PageProps {
|
||||
appContext: BaseAppContextT;
|
||||
appName: APPS;
|
||||
appName?: APPS;
|
||||
twoFactorType?: TwoFactorType;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue