diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/backend/.gitignore b/backend/.gitignore index cbba7d16..778b3011 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -4,6 +4,7 @@ src/firebase/ServiceAccountKey.json .env node_modules/ .eslintcache +ServiceAccountKey.json #Compiled JavaScript files lib/**/*.js diff --git a/frontend/public/admin.png b/frontend/public/admin.png new file mode 100644 index 00000000..e68efcfd Binary files /dev/null and b/frontend/public/admin.png differ diff --git a/frontend/public/sidebar/logo.png b/frontend/public/sidebar/logo.png index 7c1ece06..43d59e09 100644 Binary files a/frontend/public/sidebar/logo.png and b/frontend/public/sidebar/logo.png differ diff --git a/frontend/public/team.png b/frontend/public/team.png new file mode 100644 index 00000000..61e2b9fe Binary files /dev/null and b/frontend/public/team.png differ diff --git a/frontend/src/components/Button.tsx b/frontend/src/components/Button.tsx index 1495925a..9da052c5 100644 --- a/frontend/src/components/Button.tsx +++ b/frontend/src/components/Button.tsx @@ -12,19 +12,31 @@ type ButtonStyles = { primary: string; small: string; default: string; + selected: string; + big: string; }; const poppins = Poppins({ weight: "400", style: "normal", subsets: [] }); export type ButtonProps = { - label: string; + label: React.ReactNode | string; + kind?: "primary" | "secondary" | "destructive" | "destructive-secondary"; - size?: "default" | "small"; + size?: "default" | "small" | "big"; disabled?: boolean; + selected?: boolean; } & React.ComponentProps<"button">; export const Button = React.forwardRef(function Button( - { label, kind = "primary", size = "default", disabled = false, className, ...props }: ButtonProps, + { + label, + kind = "primary", + size = "default", + disabled = false, + selected = false, + className, + ...props + }: ButtonProps, ref, ) { const buttonStyles: ButtonStyles = styles as ButtonStyles; @@ -58,11 +70,18 @@ export const Button = React.forwardRef(function case "small": buttonClass += ` ${buttonStyles.small}`; break; + case "big": + buttonClass += ` ${buttonStyles.big}`; + break; default: buttonClass += ` ${buttonStyles.default}`; break; } + if (selected) { + buttonClass += ` ${buttonStyles.selected}`; + } + // Lets developers apply their own styling if (className) { buttonClass += ` ${className}`; @@ -70,7 +89,6 @@ export const Button = React.forwardRef(function // Set font to poppins buttonClass += ` ${poppins.className}`; - return ( + {isMobile && ( +
+

+ Already have an account?{" "} + Sign in +

+
+ )} + + + + + + ); +} diff --git a/frontend/src/pages/create_user_2.tsx b/frontend/src/pages/create_user_2.tsx new file mode 100644 index 00000000..ac63caa7 --- /dev/null +++ b/frontend/src/pages/create_user_2.tsx @@ -0,0 +1,144 @@ +import { ArrowLeft, ArrowRight } from "lucide-react"; +import Image from "next/image"; +import { useRouter } from "next/router"; +import { MouseEvent, useMemo, useState } from "react"; +import { FieldValues, SubmitHandler } from "react-hook-form"; + +import { Button } from "@/components/Button"; +import { useWindowSize } from "@/hooks/useWindowSize"; +import { cn } from "@/lib/utils"; + +export default function CreateUser() { + const [isAdmin, setIsAdmin] = useState(true); + + const router = useRouter(); + + const onSubmit: SubmitHandler = (data) => { + console.log(data); + void router.push("/create_user_3"); + }; + + const onBack: SubmitHandler = (data) => { + console.log(data); + void router.push("/create_user"); + }; + const { width } = useWindowSize(); + const isMobile = useMemo(() => width <= 640, [width]); + + function handleClick(event: MouseEvent): void { + switch (event.currentTarget.name) { + case "admin": + setIsAdmin(true); + break; + case "team": + setIsAdmin(false); + break; + } + } + + return ( +
+
+
+ {isMobile && ( +
+ +
+
+

+ Choose Account Type +

+
+
+
+ )} + {!isMobile && ( +
+

+ Choose Account Type +

+
+ )} + +
+
+
+ } + type="button" + name="admin" + onClick={handleClick} + selected={isAdmin} + > +
+ } + onClick={handleClick} + type="button" + name="team" + selected={!isAdmin} + > +
+ {!isMobile && ( + + )} + +
+
+
+ + +
+ ); +} diff --git a/frontend/src/pages/create_user_3.tsx b/frontend/src/pages/create_user_3.tsx new file mode 100644 index 00000000..63d357aa --- /dev/null +++ b/frontend/src/pages/create_user_3.tsx @@ -0,0 +1,78 @@ +import { ArrowLeft } from "lucide-react"; +import { useRouter } from "next/router"; +import { useMemo } from "react"; +import { FieldValues, SubmitHandler } from "react-hook-form"; + +import { useWindowSize } from "@/hooks/useWindowSize"; +import { cn } from "@/lib/utils"; + +export default function CreateUser() { + const router = useRouter(); + + const onBack: SubmitHandler = (data) => { + console.log(data); + void router.push("/create_user_2"); + }; + const { width } = useWindowSize(); + const isMobile = useMemo(() => width <= 640, [width]); + + return ( +
+
+
+ {isMobile && ( +
+ +
+
+

+ We have received +

+

+ your account creation! +

+
+
+
+ )} + {!isMobile && ( +
+ +
+

+ We have received +

+

+ your account creation! +

+
+
+ )} +

You will be notified by email

+

if your account is approved.

+

+ Haven‘t received a response yet?{" "} + + Contact Us. + +

+
+
+
+ ); +} diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 5416e497..42d544c3 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,40 +1,5 @@ -import { useForm } from "react-hook-form"; - -import { Button } from "../components/Button"; -import { Checkbox } from "../components/Checkbox"; -import StudentFormButton from "../components/StudentFormButton"; -import { Textfield } from "../components/Textfield"; -import sampleStudentData from "../sampleStudentData.json"; - -type FruitData = { - fruits: string[]; - favoriteFruit: string; -}; +import CreateUser from "./create_user"; export default function Home() { - const { register, handleSubmit, reset } = useForm(); - - const onSubmit = (formData: FruitData) => { - console.log(formData); - reset(); - }; - - return ( -
-
- - -
- - {/* Example */} -
-

Example

-
- - -
-
- ); + return ; } diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx new file mode 100644 index 00000000..1d04f6d0 --- /dev/null +++ b/frontend/src/pages/login.tsx @@ -0,0 +1,115 @@ +import Image from "next/image"; +import { useMemo } from "react"; +import { FieldValues, SubmitHandler, useForm } from "react-hook-form"; + +import { Textfield } from "@/components/Textfield"; +import { useWindowSize } from "@/hooks/useWindowSize"; +import { cn } from "@/lib/utils"; + +export default function Login() { + const { register, setValue, handleSubmit } = useForm(); + const _setValue = setValue; + + const onSubmit: SubmitHandler = (data) => { + console.log(data); + }; + const { width } = useWindowSize(); + const isMobile = useMemo(() => width <= 640, [width]); + const isTablet = useMemo(() => width <= 1300, [width]); + return ( +
+
+
+ {isMobile && ( +
+
+
+ company logo +
+
+

Welcome to

+

+ Plant it Again! +

+
+
+
+ )} + {!isMobile && ( +
+

+ Sign in to PIA +

+

+ Don‘t have an account?{" "} + + Sign up + +

+
+ )} + +
+
+
+

+ Email Address +

+ +
+
+

Password

+ +

+ Forgot Password? +

+
+ + {isMobile && ( +
+

+ Don‘t have an account?{" "} + Sign up +

+
+ )} +
+
+
+
+
+ ); +} diff --git a/frontend/src/pages/profile.tsx b/frontend/src/pages/profile.tsx index ec4fb140..f38a5d45 100644 --- a/frontend/src/pages/profile.tsx +++ b/frontend/src/pages/profile.tsx @@ -1,7 +1,56 @@ +import { FieldValues, SubmitHandler, useForm } from "react-hook-form"; + +import { Checkbox } from "../components/Checkbox"; +import Radio from "../components/Radio"; +import { Textfield } from "../components/Textfield"; + export default function Profile() { + const dietaryList = ["Nuts", "Eggs", "Seafood", "Pollen", "Dairy", "Other"]; + + const { register, setValue, handleSubmit } = useForm(); + + const onSubmit: SubmitHandler = (data) => { + console.log(data); + }; return (
-

PIA Profile Page!

+
+
+ + + +
+ +
+

Dietary Restrictions

+ +
+ +
+

Gender

+ +
+ + +
); } diff --git a/frontend/src/styles/Button.module.css b/frontend/src/styles/Button.module.css index 7356b85c..400b9dc5 100644 --- a/frontend/src/styles/Button.module.css +++ b/frontend/src/styles/Button.module.css @@ -14,6 +14,12 @@ padding-right: 1.5rem; } +.big { + height: 10rem; + padding-left: 1.5rem; + padding-right: 1.5rem; +} + .small { height: 2.5rem; padding-left: 1rem; @@ -26,6 +32,10 @@ border: none; } +.selected { + background-color: rgba(var(--primary-dark-green), 20%) !important; +} + .primary { background-color: rgb(var(--primary-dark-green)); color: rgb(var(--white)); @@ -44,7 +54,7 @@ border: 0.0625rem solid rgb(var(--primary-dark-green)); } .secondary:hover { - background-color: rgba(var(--primary-dark-green), 22%); + background-color: rgba(var(--primary-dark-green), 8%); } .secondary:active { background-color: rgba(var(--primary-dark-green), 20%); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..8b39b8cd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "PIA-Program-Manager", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}