From 9731fe275decb7012a78c97459e53c4f7fd23341 Mon Sep 17 00:00:00 2001 From: Olasunkanmi Oyinlola Date: Fri, 16 Feb 2024 15:16:45 +0800 Subject: [PATCH] create the home page and update the sign in Page --- .../src/components/AppForms/SignInForm.tsx | 98 ++++++++++++++----- .../src/components/Utilities/AuthModal.tsx | 28 ++++++ frontend/src/components/Utilities/Navbar.tsx | 3 + frontend/src/components/Utilities/tab.tsx | 28 ++++++ frontend/src/pages/Landing.tsx | 16 ++- 5 files changed, 148 insertions(+), 25 deletions(-) create mode 100644 frontend/src/components/Utilities/AuthModal.tsx create mode 100644 frontend/src/components/Utilities/tab.tsx diff --git a/frontend/src/components/AppForms/SignInForm.tsx b/frontend/src/components/AppForms/SignInForm.tsx index f538ea07..87d7de2a 100644 --- a/frontend/src/components/AppForms/SignInForm.tsx +++ b/frontend/src/components/AppForms/SignInForm.tsx @@ -3,6 +3,8 @@ import { Button, Card, Form } from "react-bootstrap"; import { SubmitHandler, useForm } from "react-hook-form"; import { z } from "zod"; import { FormInput } from "../Forms/form-input"; +import { TabComponent } from "../Utilities/tab"; +import { Link } from "react-router-dom"; export type loginFormProps = { email: string; @@ -22,31 +24,81 @@ export const LoginForm = () => { handleSubmit, formState: { errors }, } = useForm({ resolver: zodResolver(validateInputSchema) }); + const EmailSignUp = () => { + return ( + + +
+ + id="email" + name="email" + placeholder="Enter email" + register={register} + errors={errors} + /> + + id="password" + name="password" + placeholder="Enter password" + register={register} + errors={errors} + /> + + +
+
+ ); + }; + + const PhoneNumberSignUp = () => { + return ( + + +
+ + id="email" + name="email" + placeholder="Enter phone number" + register={register} + errors={errors} + /> + + +
+
+ ); + }; + + const signUpTab = [ + { title: "Email", children: }, + { title: "Phone", children: }, + ]; const onSubmit: SubmitHandler = (data) => console.log(data); return ( - - -
- - id="email" - name="email" - placeholder="Enter email" - register={register} - errors={errors} - /> - - id="password" - name="password" - placeholder="Enter password" - register={register} - errors={errors} - /> - - -
-
+
+
+ +

Login to your Account

+
+
+ +
+

+ Don't have an account? Sign up +

+
+
); }; diff --git a/frontend/src/components/Utilities/AuthModal.tsx b/frontend/src/components/Utilities/AuthModal.tsx new file mode 100644 index 00000000..b304ad19 --- /dev/null +++ b/frontend/src/components/Utilities/AuthModal.tsx @@ -0,0 +1,28 @@ +import { CSSProperties } from "react"; +import { Button } from "react-bootstrap"; +import { useNavigate } from "react-router-dom"; + +export const AuthModal = () => { + const navigate = useNavigate(); + const handleSignIn = () => { + navigate("/login"); + }; + const buttonStyle: CSSProperties = { + width: "100%", + margin: "auto", + }; + return ( +
+
+ +
+
+ +
+
+ ); +}; diff --git a/frontend/src/components/Utilities/Navbar.tsx b/frontend/src/components/Utilities/Navbar.tsx index 56cef286..aa8b6de7 100644 --- a/frontend/src/components/Utilities/Navbar.tsx +++ b/frontend/src/components/Utilities/Navbar.tsx @@ -50,6 +50,9 @@ export const Navigation = () => { + {/* + Profile + */} + +
+ + + +
); };