diff --git a/.DS_Store b/.DS_Store
index 8f734f9..bd77abc 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/client/package-lock.json b/client/package-lock.json
index 7eeba37..9f53e45 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -1158,6 +1158,7 @@
"version": "1.7.9",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
+ "license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
diff --git a/client/public/images/signupPage1.png b/client/public/images/signupPage1.png
new file mode 100644
index 0000000..9300806
Binary files /dev/null and b/client/public/images/signupPage1.png differ
diff --git a/client/src/app/signup/page.tsx b/client/src/app/signup/page.tsx
index 2e60409..deea5d4 100644
--- a/client/src/app/signup/page.tsx
+++ b/client/src/app/signup/page.tsx
@@ -1,41 +1,90 @@
+import React from "react";
import Navbar from "@/components/navbar";
-import Background from "@/components/background";
-import Footer from "@/components/footer";
-import { CredentialsForm } from "@/components/credentialsForm";
-import { GoogleSignInButton } from "@/components/authButtons";
+// import Footer from "@/components/footer"; Do we need a footer?
import Link from "next/link";
+import { CredentialsFormDark } from "@/components/credentialsFormDark";
+import { getServerSession } from "next-auth";
+import { authConfig } from "@/lib/auth";
+import { redirect } from "next/navigation";
-export default function LogoutPage() {
- return (
- <>
-
-
-
-
-
-
-
- or
-
-
-
-
-
- Already have an account?{" "}
-
- Log in
- {" "}
-
-
-
-
-
-
- >
- );
+export default async function SignupPage() {
+ const session = await getServerSession(authConfig);
+ if (session) return redirect("/dashboard");
+
+ const styles = {
+ pageBackground: {
+ width: "100vw",
+ height: "100vh",
+ // Full-page image or color
+ backgroundImage: 'url("/images/signupPage1.png")',
+ backgroundSize: "cover",
+ backgroundPosition: "center",
+ position: "relative",
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ },
+ overlayBackground: {
+ width: "1366px",
+ height: "768px",
+ backgroundColor: "rgba(255, 255, 255, 0.2)", // more transparent
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ },
+ signupCard: {
+ width: "400px",
+ backgroundColor: "rgba(0, 0, 0, 0.7)", // less transparent
+ borderRadius: "15px",
+ padding: "2rem",
+ boxShadow: "0 4px 20px rgba(0, 0, 0, 0.1)",
+ },
+ heading: {
+ fontSize: "2rem",
+ color: "white",
+ marginBottom: "20px",
+ textAlign: "center",
+ },
+ textCenter: {
+ textAlign: "center",
+ color: "white",
+ marginTop: "20px",
+ },
+ };
+
+ return (
+ <>
+ {/* Render the navbar with only the logo (remove later if we want full navbar?) */}
+
+
+ {/* Layer 1: Full-page background */}
+
+
+ {/* Layer 2: 1366 x 768 background box */}
+
+
+ {/* Layer 3: The signup card */}
+
+
Welcome!
+
+ {/* Credentials form (Email/Password) */}
+
+
+
+
+ Already have an account?{" "}
+
+ Log in
+
+
+
+
+
+
+
+ {/* */}
+ >
+ );
}
diff --git a/client/src/app/signup/styles.css b/client/src/app/signup/styles.css
new file mode 100644
index 0000000..2f6c3dd
--- /dev/null
+++ b/client/src/app/signup/styles.css
@@ -0,0 +1,3 @@
+.focus:focus {
+ outline: 2px solid rgb(255, 255, 255)
+}
\ No newline at end of file
diff --git a/client/src/components/credentialsFormDark.tsx b/client/src/components/credentialsFormDark.tsx
new file mode 100644
index 0000000..bd6270a
--- /dev/null
+++ b/client/src/components/credentialsFormDark.tsx
@@ -0,0 +1,142 @@
+"use client";
+
+import prisma from "@/lib/prisma";
+import { signIn } from "next-auth/react";
+import { redirect } from "next/navigation";
+import { useState } from "react";
+import bcrypt from "bcryptjs";
+import { loginAuthentication, signup } from "@/utils/login-utils";
+import "../app/signup/styles.css"
+
+interface CredentialsFormProps {
+ csrfToken?: string;
+ buttonText: string;
+}
+
+export function CredentialsFormDark(props: CredentialsFormProps) {
+ const [error, setError] = useState(null);
+
+ const handleSubmit = async (e: any) => {
+ e.preventDefault();
+ const data = new FormData(e.currentTarget);
+
+ // switch (props.buttonText) {
+ // case "Sign up":
+ // const user = await prisma.user.create({
+ // data: {
+ // email: data.get("email") as string,
+ // password: bcrypt.hashSync(data.get("password") as string, 10),
+ // },
+ // });
+ // break;
+ // case "Sign in":
+ // }
+
+ // const signInResponse = await signIn("credentials", {
+ // email: data.get("email"),
+ // password: data.get("password"),
+ // redirect: false,
+ // });
+
+ // if (signInResponse && !signInResponse.error) {
+ // redirect("/profile/edit");
+ // } else {
+ // setError("Your email or password was incorrect.");
+ // }
+
+ const email = data.get("email") as String;
+ const password = data.get("password") as String;
+ if(props.buttonText==='Sign up'){
+ const response: any = await signup(email,password);
+ if(response.status !== 200){// Response not Okay so the status is 401
+ setError(response.message);
+ }
+ // TASK: DO SOMETHING ON SUCCESSFUL SIGNUP
+ } else{
+ const response: any = await loginAuthentication(email,password);
+ if(response.status !== 200){// Response not Okay so the status is 401
+ setError(response.message);
+ }
+ // TASK: DO SOMETHING ON SUCCESSFUL LOGIN
+ }
+ };
+
+ return (
+
+ );
+}
diff --git a/client/src/components/navbar.tsx b/client/src/components/navbar.tsx
index 71bded4..35376d0 100644
--- a/client/src/components/navbar.tsx
+++ b/client/src/components/navbar.tsx
@@ -9,15 +9,17 @@ export default function Navbar({
pageLocation,
hideInitialNav,
onlyLogo = false, // New prop to toggle the minimal navbar
+ onlyLogoLight = false,
}: {
pageLocation: string;
hideInitialNav: boolean;
onlyLogo?: boolean; // New prop
+ onlyLogoLight?: boolean; // For the signup page
}) {
// Check if the navbar should only show the logo
if (onlyLogo) {
return (
-
+
+ );
+ }
+
const [scrollPosition, setScrollPosition] = useState(0);
const [navbarOpen, setNavbarOpen] = useState(false);