From a269274359feac820bda8cf0fb3390c75d1c7ac1 Mon Sep 17 00:00:00 2001 From: Mag <166319982+magali-la@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:50:23 -0500 Subject: [PATCH 01/13] feat(dashboard): store user tasks from modal in local storage on save, updated route for save button --- src/components/Dashboard/TaskModal.jsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/Dashboard/TaskModal.jsx b/src/components/Dashboard/TaskModal.jsx index 1e96f06..f7beaf6 100644 --- a/src/components/Dashboard/TaskModal.jsx +++ b/src/components/Dashboard/TaskModal.jsx @@ -1,8 +1,11 @@ import { useEffect, useState } from 'react'; import Button from "../Button"; import { IoClose } from "react-icons/io5"; +import { useNavigate } from 'react-router-dom'; export default function TaskModal({ isOpen, onClose}) { + const navigate = useNavigate(); + const [selectedTask, setSelectedTask] = useState([]); // log the selectedTask after the array changes to update automatically @@ -22,7 +25,17 @@ export default function TaskModal({ isOpen, onClose}) { console.log(`${challenge} button deselected!`); setSelectedTask(selectedTask.filter(item => item !== challenge)); } - } + } + + // function to save selected tasks in local storage for dashboard states + function saveTasks(){ + // save to local storage + localStorage.setItem("userTasks", JSON.stringify(selectedTask)); + console.log("User saved these tasks:", selectedTask); + + // then route to the challenges page + navigate("/challenges"); + } if (!isOpen) return null; @@ -69,7 +82,7 @@ export default function TaskModal({ isOpen, onClose}) { isActive={selectedTask.includes('Journal Entry: Respond to journal prompts or share your thoughts and feelings each day.')} /> - ); } From 64a02040a91feb55ed6d8a8774d583c9a648495e Mon Sep 17 00:00:00 2001 From: Mag <166319982+magali-la@users.noreply.github.com> Date: Fri, 12 Dec 2025 02:21:32 -0500 Subject: [PATCH 09/13] feat(dashboard): add journal completed days data to firestore for dashboard detox summary logic --- src/pages/journal.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/journal.jsx b/src/pages/journal.jsx index 9579a00..92cb9b9 100644 --- a/src/pages/journal.jsx +++ b/src/pages/journal.jsx @@ -4,7 +4,7 @@ import { useLocation, useNavigate } from 'react-router-dom'; // firebase import { db, auth } from '../firebase'; -import { doc, setDoc, onSnapshot } from 'firebase/firestore'; +import { doc, setDoc, onSnapshot, updateDoc } from 'firebase/firestore'; import { onAuthStateChanged } from 'firebase/auth'; //components @@ -148,6 +148,14 @@ const Journal = () => { console.error('Error saving journal entry:', error) ); + // firestore save for dashboard under users collection + const userDocRef = doc(db, "users", userId); + updateDoc(userDocRef, { + journalProgress: { + completedDays: finalEffectiveDays + } + }); + return { effectiveDays: finalEffectiveDays, entries: newEntries, From a615af0d16af8ca412a29335508a3be613573589 Mon Sep 17 00:00:00 2001 From: Mag <166319982+magali-la@users.noreply.github.com> Date: Fri, 12 Dec 2025 09:40:44 -0500 Subject: [PATCH 10/13] feat(progress overview): add progress day component, and variant to dashboard tile to display completed days in progress overview, add empty state --- src/components/Dashboard/DashboardTile.jsx | 25 +++++++++++++++++++++- src/components/Dashboard/ProgressDay.jsx | 14 ++++++++++++ src/pages/Dashboard.jsx | 6 ++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/components/Dashboard/ProgressDay.jsx diff --git a/src/components/Dashboard/DashboardTile.jsx b/src/components/Dashboard/DashboardTile.jsx index 8f1a0e3..cc2285f 100644 --- a/src/components/Dashboard/DashboardTile.jsx +++ b/src/components/Dashboard/DashboardTile.jsx @@ -1,4 +1,5 @@ import { tv } from "tailwind-variants/lite"; +import ProgressDay from "./ProgressDay"; const tileVariants = tv({ base: 'font-poppins flex flex-col justify-start py-6 px-4 rounded-lg shadow-[0_4px_15px_rgba(0,0,0,0.25)]', @@ -15,6 +16,7 @@ const tileVariants = tv({ type: { regular: '', data: '', + progress: '' }, }, }); @@ -30,7 +32,7 @@ const imgVariants = tv({ }, }); -export default function DashboardTile({ type, size, span, title, subtitle, imgSource, altText, dataSentence }){ +export default function DashboardTile({ type, size, span, title, subtitle, imgSource, altText, dataSentence, progressDays }){ return (
{type == "data" ? ( @@ -39,6 +41,27 @@ export default function DashboardTile({ type, size, span, title, subtitle, imgSo

{dataSentence}

{subtitle}

+ ) : type == "progress" ? ( +
+

{title}

+

{subtitle}

+ { progressDays.length > 0 ? ( + /* div for progress map */ +
+ { progressDays.map(day => ( + + ))} +
+ ) : ( + // image for empty state - no completed challenges yet + {altText} + )} +
) : (

{title}

diff --git a/src/components/Dashboard/ProgressDay.jsx b/src/components/Dashboard/ProgressDay.jsx new file mode 100644 index 0000000..d7a61c3 --- /dev/null +++ b/src/components/Dashboard/ProgressDay.jsx @@ -0,0 +1,14 @@ +import { FaCircle, FaCircleCheck } from "react-icons/fa6" + +export default function ProgressDay({ day }) { + return ( +
+
+

Journal

+ +

Day {day}

+
+ +
+ ) +} \ No newline at end of file diff --git a/src/pages/Dashboard.jsx b/src/pages/Dashboard.jsx index 91f8e95..3e1c7f6 100644 --- a/src/pages/Dashboard.jsx +++ b/src/pages/Dashboard.jsx @@ -73,6 +73,10 @@ export default function Dashboard() { } }, [user]); + // define variable for a progress day array showing 3 most recent completed tasks, filter numbers over 0 for empty state + let progressArray = [completedDays, completedDays - 1, completedDays - 2].filter(num => num > 0); + console.log("Progress array:", progressArray); + return (
{/* title and button */} @@ -122,12 +126,14 @@ export default function Dashboard() { /> {/* row 2 */} Date: Fri, 12 Dec 2025 10:51:03 -0500 Subject: [PATCH 11/13] feat(task modal): add button variant for task modal button, add conditional render for title and subtitle props, adjust modal responsiveness --- src/components/Button.jsx | 13 ++++++++-- src/components/Dashboard/TaskModal.jsx | 35 +++++++++++++++----------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/components/Button.jsx b/src/components/Button.jsx index c5697d2..e665e36 100644 --- a/src/components/Button.jsx +++ b/src/components/Button.jsx @@ -11,6 +11,7 @@ const buttonVariants = tv({ sm: 'h-12 w-[162px] text-base font-semibold rounded-lg lg:h-14 lg:w-[220px] lg:text-xl', md: 'h-11 w-[218px] text-base font-semibold rounded-lg lg:h-14 lg:w-[286px] lg:text-xl xl:h-16 xl:w-[327px] xl:text-2xl', lg: 'h-11 w-[345px] text-base font-medium rounded-md lg:w-[501px]', + xl: 'h-fit w-full md:w-[345px] text-sm sm:text-base font-medium rounded-md lg:w-[501px] 2xl:w-full p-3 justify-start', circ: 'h-11 w-11 text-2xl rounded-full' }, color: { @@ -35,7 +36,7 @@ const buttonVariants = tv({ ], }); -export default function Button({ size, color, label, onClick, isActive, to, ...props }) { +export default function Button({ size, color, label, onClick, isActive, to, title, subtitle, ...props }) { let navigate = useNavigate(); function handleClick() { @@ -50,7 +51,15 @@ export default function Button({ size, color, label, onClick, isActive, to, ...p ); } diff --git a/src/components/Dashboard/TaskModal.jsx b/src/components/Dashboard/TaskModal.jsx index 495e558..f47974f 100644 --- a/src/components/Dashboard/TaskModal.jsx +++ b/src/components/Dashboard/TaskModal.jsx @@ -54,49 +54,54 @@ export default function TaskModal({ isOpen, onClose, user}) { if (!isOpen) return null; return ( -
-
+
+
-

Detox Challenge Options

+

Detox Challenge Options

{/* buttons */} -
+
-
); From 6b92a0917b7037c9cd50dea1990f9b95cf54ccd6 Mon Sep 17 00:00:00 2001 From: Mag <166319982+magali-la@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:24:49 -0500 Subject: [PATCH 12/13] feat(dashboard tile): add link to community for dashboard tile, pass onClick and onKeyDown props to tile, implement custom styling and accessibility features --- src/App.css | 5 +++++ src/components/Dashboard/DashboardTile.jsx | 11 +++++++++-- src/pages/Dashboard.jsx | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/App.css b/src/App.css index c03681c..b55fd80 100644 --- a/src/App.css +++ b/src/App.css @@ -18,3 +18,8 @@ button.active { button.active:hover { background-color: var(--color-persianblue); } +/* style for focus for dashboard tile link */ +.dash-tile-link:focus-visible { + outline: solid 4px var(--color-persianblue); + outline-offset: 8px; +} \ No newline at end of file diff --git a/src/components/Dashboard/DashboardTile.jsx b/src/components/Dashboard/DashboardTile.jsx index cc2285f..f26d1d9 100644 --- a/src/components/Dashboard/DashboardTile.jsx +++ b/src/components/Dashboard/DashboardTile.jsx @@ -32,9 +32,16 @@ const imgVariants = tv({ }, }); -export default function DashboardTile({ type, size, span, title, subtitle, imgSource, altText, dataSentence, progressDays }){ +export default function DashboardTile({ type, size, span, title, subtitle, imgSource, altText, dataSentence, progressDays, onClick, onKeyDown }){ return ( -
+ // if an onClick prop exists, set a cursor pointer, add a role of button, and make it open to tab nav +
{type == "data" ? (

{title}

diff --git a/src/pages/Dashboard.jsx b/src/pages/Dashboard.jsx index 3e1c7f6..9e5e6dd 100644 --- a/src/pages/Dashboard.jsx +++ b/src/pages/Dashboard.jsx @@ -5,6 +5,7 @@ import TaskModal from "../components/Dashboard/TaskModal"; import { auth, db } from "../firebase"; import { doc, onSnapshot } from "firebase/firestore"; import { onAuthStateChanged } from "firebase/auth"; +import { useNavigate } from "react-router-dom"; let loginStreak = 1; @@ -77,6 +78,9 @@ export default function Dashboard() { let progressArray = [completedDays, completedDays - 1, completedDays - 2].filter(num => num > 0); console.log("Progress array:", progressArray); + // logic to click tile and navigate to community + let navigate = useNavigate(); + return (
{/* title and button */} @@ -142,6 +146,8 @@ export default function Dashboard() { subtitle="Review answers to prompts from other women in tech" imgSource="/people.svg" altText="illustration of four diverse women" + onClick={() => navigate("/community")} + onKeyDown={(event) => event.key === 'Enter' ? navigate("/community") : null} />
) : ( From d45e00887616cb317d8607331114ba44c674813d Mon Sep 17 00:00:00 2001 From: Mag <166319982+magali-la@users.noreply.github.com> Date: Sun, 14 Dec 2025 10:38:58 -0500 Subject: [PATCH 13/13] fix(task modal): adjust responsiveness by height with overflow, add accessibility features to modal --- src/components/Button.jsx | 2 +- src/components/Dashboard/TaskModal.jsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Button.jsx b/src/components/Button.jsx index e665e36..2c49d88 100644 --- a/src/components/Button.jsx +++ b/src/components/Button.jsx @@ -11,7 +11,7 @@ const buttonVariants = tv({ sm: 'h-12 w-[162px] text-base font-semibold rounded-lg lg:h-14 lg:w-[220px] lg:text-xl', md: 'h-11 w-[218px] text-base font-semibold rounded-lg lg:h-14 lg:w-[286px] lg:text-xl xl:h-16 xl:w-[327px] xl:text-2xl', lg: 'h-11 w-[345px] text-base font-medium rounded-md lg:w-[501px]', - xl: 'h-fit w-full md:w-[345px] text-sm sm:text-base font-medium rounded-md lg:w-[501px] 2xl:w-full p-3 justify-start', + xl: 'h-fit w-full md:w-[450px] text-sm sm:text-base font-medium rounded-md lg:w-[501px] 2xl:w-full p-3 justify-start', circ: 'h-11 w-11 text-2xl rounded-full' }, color: { diff --git a/src/components/Dashboard/TaskModal.jsx b/src/components/Dashboard/TaskModal.jsx index f47974f..58f8865 100644 --- a/src/components/Dashboard/TaskModal.jsx +++ b/src/components/Dashboard/TaskModal.jsx @@ -54,10 +54,10 @@ export default function TaskModal({ isOpen, onClose, user}) { if (!isOpen) return null; return ( -
-
+
+
-

Detox Challenge Options

+ {/* buttons */}
-
);