From 49d92321980101c01124f187f29021670954bf6a Mon Sep 17 00:00:00 2001 From: Spencer Schoeneman <78219375+Spencer-Sch@users.noreply.github.com> Date: Thu, 16 Nov 2023 10:48:27 -0600 Subject: [PATCH] added UI for initial login/signup process (#3) --- .../web-3-crew/ExistingOrNewMember.tsx | 34 +++++++++ .../web-3-crew/LoginEmailOrWallet.tsx | 42 +++++++++++ .../web-3-crew/RegisterCompanyOrEmployee.tsx | 42 +++++++++++ packages/nextjs/pages/dapp.tsx | 74 +++++++++++++++++++ 4 files changed, 192 insertions(+) create mode 100644 packages/nextjs/components/web-3-crew/ExistingOrNewMember.tsx create mode 100644 packages/nextjs/components/web-3-crew/LoginEmailOrWallet.tsx create mode 100644 packages/nextjs/components/web-3-crew/RegisterCompanyOrEmployee.tsx create mode 100644 packages/nextjs/pages/dapp.tsx diff --git a/packages/nextjs/components/web-3-crew/ExistingOrNewMember.tsx b/packages/nextjs/components/web-3-crew/ExistingOrNewMember.tsx new file mode 100644 index 0000000..c1fce54 --- /dev/null +++ b/packages/nextjs/components/web-3-crew/ExistingOrNewMember.tsx @@ -0,0 +1,34 @@ +import { FormSteps } from "~~/pages/dapp"; + +interface props { + updateFormState: (value: FormSteps) => void; +} + +const ExistingOrNewMember = ({ updateFormState }: props) => { + return ( +
+ + +
+ ); +}; + +export default ExistingOrNewMember; diff --git a/packages/nextjs/components/web-3-crew/LoginEmailOrWallet.tsx b/packages/nextjs/components/web-3-crew/LoginEmailOrWallet.tsx new file mode 100644 index 0000000..497ef84 --- /dev/null +++ b/packages/nextjs/components/web-3-crew/LoginEmailOrWallet.tsx @@ -0,0 +1,42 @@ +import { FormSteps } from "~~/pages/dapp"; + +interface props { + updateFormState: (value: FormSteps) => void; +} + +const LoginEmailOrWallet = ({ updateFormState }: props) => { + return ( + <> + {/* Back Button */} + + {/* Main Buttons */} +
+ + +
+ + ); +}; + +export default LoginEmailOrWallet; diff --git a/packages/nextjs/components/web-3-crew/RegisterCompanyOrEmployee.tsx b/packages/nextjs/components/web-3-crew/RegisterCompanyOrEmployee.tsx new file mode 100644 index 0000000..98cc1e9 --- /dev/null +++ b/packages/nextjs/components/web-3-crew/RegisterCompanyOrEmployee.tsx @@ -0,0 +1,42 @@ +import { FormSteps } from "~~/pages/dapp"; + +interface props { + updateFormState: (value: FormSteps) => void; +} + +const RegisterCompanyOrEmployee = ({ updateFormState }: props) => { + return ( + <> + {/* Back Button */} + + {/* Main Buttons */} +
+ + +
+ + ); +}; + +export default RegisterCompanyOrEmployee; diff --git a/packages/nextjs/pages/dapp.tsx b/packages/nextjs/pages/dapp.tsx new file mode 100644 index 0000000..b2e3dce --- /dev/null +++ b/packages/nextjs/pages/dapp.tsx @@ -0,0 +1,74 @@ +import { ReactElement, useState } from "react"; +// import Link from "next/link"; +import type { NextPageWithLayout } from "./_app"; +// import { MetaHeader } from "~~/components/MetaHeader"; +import CleanLayout from "~~/components/layouts/CleanLayout"; +import ExistingOrNewMember from "~~/components/web-3-crew/ExistingOrNewMember"; +import LoginEmailOrWallet from "~~/components/web-3-crew/LoginEmailOrWallet"; +import RegisterCompanyOrEmployee from "~~/components/web-3-crew/RegisterCompanyOrEmployee"; + +export type FormSteps = "start" | "login" | "signup" | "register-company" | "register-employee"; + +const LandingPage: NextPageWithLayout = () => { + const [formState, setFormState] = useState("start"); + + function updateFormState(value: FormSteps) { + switch (value) { + case "start": + setFormState(value); + break; + case "login": + setFormState(value); + break; + case "signup": + setFormState(value); + break; + case "register-company": + setFormState(value); + break; + case "register-employee": + setFormState(value); + break; + default: + } + } + + return ( + <> + {/* Look into MetaHeader - should it be moved to _app.tsx ??? */} + {/* Container */} +
+ {/* Form container */} +
+ {/* Initial Options */} + {formState === "start" || "login" ? ( + <> +
+

CCIP Payroll

+
+ {formState === "start" && } + {formState === "login" && } + + ) : null} + {/* Signup Options */} + {formState === "signup" ? ( + <> +
+

+ Are you registering as a company or employee? +

+
+ + + ) : null} +
+
+ + ); +}; + +LandingPage.getLayout = function getLayout(page: ReactElement) { + return {page}; +}; + +export default LandingPage;