From 7e213239b5a46bf704e84173247e656da0ac5c2d Mon Sep 17 00:00:00 2001 From: Erica Birdsong <97683338+ermaria@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:52:35 -0500 Subject: [PATCH] Create page.tsx --- compass/app/page.tsx | 86 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 compass/app/page.tsx diff --git a/compass/app/page.tsx b/compass/app/page.tsx new file mode 100644 index 0000000..c100b0d --- /dev/null +++ b/compass/app/page.tsx @@ -0,0 +1,86 @@ +// pages/index.tsx +"use client"; + +import Button from '@/components/Button'; +import Input from '@/components/Input' +import InlineLink from '@/components/InlineLink'; +import Paper from '@/components/auth/Paper'; +// import { Metadata } from 'next' +import Image from 'next/image'; +import {ChangeEvent, useState} from "react"; + +// export const metadata: Metadata = { +// title: 'Login', +// } + +export default function Page() { + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [error, setError] = useState(""); + + const handleEmailChange = (event: React.ChangeEvent) => { + setEmail(event.currentTarget.value); + console.log("email " + email); + } + + const handlePasswordChange = (event: React.ChangeEvent) => { + setPassword(event.currentTarget.value); + console.log("password " + password) + } + + const handleClick = (event: React.MouseEvent) => { + event.preventDefault(); + // Priority: Incorrect combo > Missing email > Missing password + + if (password.trim().length === 0) { + setError("Please enter your password.") + } + // This shouldn't happen, already provides validation, but just in case. + if (email.trim().length === 0) { + setError("Please enter your email.") + } + // Placeholder for incorrect email + password combo. + if (email === "incorrect@gmail.com" && password) { + setError("Incorrect password.") + } + } + + + + return ( + <> + +
+ Compass Center logo. +

Login

+
+ +
+
+ +
+
+ + Forgot password? + + + + +
+
+

+ © 2024 Compass Center +

+
+ + ); +};