From ed5abe81ad7d1731a28670c36b7bdfdf3a3ef283 Mon Sep 17 00:00:00 2001
From: Dainiz Almazan Bustos <85927389+dainizzz@users.noreply.github.com>
Date: Wed, 10 Dec 2025 22:10:52 -0800
Subject: [PATCH 1/2] Adds login modal
---
src/Components/LoginModal.jsx | 69 ++++++++++++++++++++++++++++++++++
src/Components/NavBar.jsx | 21 +++++------
src/Context/UserContext.jsx | 10 +++++
src/assets/icons/closeIcon.svg | 4 ++
src/styles/LoginModal.css | 37 ++++++++++++++++++
5 files changed, 129 insertions(+), 12 deletions(-)
create mode 100644 src/Components/LoginModal.jsx
create mode 100644 src/assets/icons/closeIcon.svg
create mode 100644 src/styles/LoginModal.css
diff --git a/src/Components/LoginModal.jsx b/src/Components/LoginModal.jsx
new file mode 100644
index 0000000..e635593
--- /dev/null
+++ b/src/Components/LoginModal.jsx
@@ -0,0 +1,69 @@
+import "../styles/LoginModal.css";
+import { useState } from "react";
+import { useNavigate } from "react-router-dom";
+import { useUserContext } from "../Context/UserContext";
+import closeIcon from "../assets/icons/closeIcon.svg";
+
+export default function LoginModal() {
+ const navigate = useNavigate();
+ const { setIsLoggedIn, setShowLoginModal } = useUserContext();
+ const [email, setEmail] = useState("");
+ const [password, setPassword] = useState("");
+
+ function handleLogin() {
+ if (email && password) {
+ setIsLoggedIn(true);
+ setShowLoginModal(false);
+ navigate("/dashboard");
+ }
+ }
+
+ function handleClose() {
+ setShowLoginModal(false);
+ }
+
+ return (
+
+
+
+
+
+
Welcome, Collaborator!
+
+ Ready to connect? Enter your email to begin your mission. This is a
+ private, secure space designed for you and your teammates. Your
+ mission of connection starts here.
+
+
+
+
Forgot your password?
+
Log In
+
+ Don't have an account yet? Sign up here!
+
+
+
+
+ );
+}
diff --git a/src/Components/NavBar.jsx b/src/Components/NavBar.jsx
index 8f23a74..6ca3e82 100644
--- a/src/Components/NavBar.jsx
+++ b/src/Components/NavBar.jsx
@@ -1,19 +1,12 @@
-import { NavLink, useLocation, useNavigate } from "react-router-dom";
-import { useState } from "react";
+import { NavLink, useLocation } from "react-router-dom";
import logo from "../assets/icons/logo.svg";
import "../styles/NavBar.css";
import NavUserSection from "./NavUserSection";
+import LoginModal from "./LoginModal";
+import { useUserContext } from "../Context/UserContext";
export default function NavBar() {
- const navigate = useNavigate();
- const [isLoggedIn, setIsLoggedIn] = useState(false);
-
- // TODO: Update to link to the dashboard after activity has been completed
- const handleLoginClick = () => {
- setIsLoggedIn(true);
- navigate("/dashboard");
- };
-
+ const { showLoginModal, setShowLoginModal, isLoggedIn } = useUserContext();
const { pathname } = useLocation();
const hideOnActivity =
@@ -24,8 +17,13 @@ export default function NavBar() {
if (hideOnActivity || hideOnResults) return null;
+ function handleLoginClick() {
+ setShowLoginModal(true);
+ }
+
return (
+ {showLoginModal ? : <>>}
@@ -50,7 +48,6 @@ export default function NavBar() {
Your Team
- {/* Just use testing-Remove later */}
(isActive ? "activeLink" : "")}
diff --git a/src/Context/UserContext.jsx b/src/Context/UserContext.jsx
index 1152196..5ce7365 100644
--- a/src/Context/UserContext.jsx
+++ b/src/Context/UserContext.jsx
@@ -7,6 +7,10 @@ export const defaultState = {
setQuizScore: () => {},
missionCompleted: false,
setMissionCompleted: () => {},
+ isLoggedIn: false,
+ setIsLoggedIn: () => {},
+ showLoginModal: false,
+ setShowLoginModal: () => {},
};
export const UserContext = createContext(defaultState);
@@ -17,6 +21,8 @@ export const UserContextProvider = ({ children }) => {
const [activityCompleted, setActivityCompleted] = useState(false);
const [quizScore, setQuizScore] = useState(0);
const [missionCompleted, setMissionCompleted] = useState(false);
+ const [isLoggedIn, setIsLoggedIn] = useState(false);
+ const [showLoginModal, setShowLoginModal] = useState(false);
const value = {
activityCompleted,
setActivityCompleted,
@@ -24,6 +30,10 @@ export const UserContextProvider = ({ children }) => {
setQuizScore,
missionCompleted,
setMissionCompleted,
+ isLoggedIn,
+ setIsLoggedIn,
+ showLoginModal,
+ setShowLoginModal,
};
return {children} ;
};
diff --git a/src/assets/icons/closeIcon.svg b/src/assets/icons/closeIcon.svg
new file mode 100644
index 0000000..000fbf3
--- /dev/null
+++ b/src/assets/icons/closeIcon.svg
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/src/styles/LoginModal.css b/src/styles/LoginModal.css
new file mode 100644
index 0000000..fe35c60
--- /dev/null
+++ b/src/styles/LoginModal.css
@@ -0,0 +1,37 @@
+.loginModalOverlayer {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ background: rgba(0, 0, 0, 0.15);
+ align-items: center;
+ z-index: 1000;
+}
+
+.loginModal {
+ width: 32.5rem;
+ height: 37.5rem;
+ border-radius: 0.5rem;
+ background: #fff;
+ color: #1c1c1e;
+ box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
+ display: flex;
+ flex-flow: column;
+ padding: 1rem;
+}
+
+.loginModal > h2 {
+ font-size: 1.75rem;
+ font-weight: 700;
+ line-height: 1.875rem;
+}
+
+.loginModal p {
+ color: #1c1c1e;
+ font-size: 1rem;
+ font-weight: 400;
+ line-height: 1.375rem;
+}
From b508d2e1b8cacd6aab0c1767fa10cf918d94c7d9 Mon Sep 17 00:00:00 2001
From: anabel
Date: Sat, 13 Dec 2025 10:28:21 -0800
Subject: [PATCH 2/2] some initial styling
---
src/Components/LoginModal.jsx | 6 ++---
src/styles/LoginModal.css | 50 ++++++++++++++++++++++++++++++++++-
2 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/src/Components/LoginModal.jsx b/src/Components/LoginModal.jsx
index e635593..4c0b2a0 100644
--- a/src/Components/LoginModal.jsx
+++ b/src/Components/LoginModal.jsx
@@ -35,7 +35,7 @@ export default function LoginModal() {
mission of connection starts here.