From e641697be98b1ca0531e65b726b1b53d3ae10cf5 Mon Sep 17 00:00:00 2001 From: funbunch Date: Mon, 10 Nov 2025 14:31:13 -0800 Subject: [PATCH 1/4] feat: add mobile hamburger menu --- .../calendarHeader/CalendarHeader.jsx | 8 +-- client/src/features/home/HamburgerNav.jsx | 52 ++++++++++++++----- client/src/pages/CalendarPage.jsx | 5 +- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/client/src/features/calendarHeader/CalendarHeader.jsx b/client/src/features/calendarHeader/CalendarHeader.jsx index ee88dc14..b859e224 100644 --- a/client/src/features/calendarHeader/CalendarHeader.jsx +++ b/client/src/features/calendarHeader/CalendarHeader.jsx @@ -30,8 +30,8 @@ function CalendarHeader({ date }) { }; return ( -
-
+
+
navigate("/")} />
-
+
Logo date.getCurrentMonth()} />
-
+
{ + const defaultLinks = [{ name: "HOME", link: "/", type: "button" }]; + if (location.pathname.includes("calendar")) { + defaultLinks.push({ + name: "ADD EVENT", + action: formModal.handleOpen, + type: "function", + }); + } else { + defaultLinks.push({ + name: "CALENDAR", + link: "/calendar", + type: "button", + }); + } - if (!isAuthenticated()) { - Links.push({ name: "LOG IN", link: "api/auth/discord", type: "a" }); - } else { - Links.push({ name: "LOG OUT", onClick: logout, type: "button" }); - } + if (!isAuthenticated()) { + defaultLinks.push({ + name: "LOG IN", + link: "api/auth/discord", + type: "a", + }); + } else { + defaultLinks.push({ name: "LOG OUT", action: logout, type: "function" }); + } - let [open, setOpen] = useState(false); + return defaultLinks; + }; + + const menuItems = links || getDefaultLinks(); + + const [open, setOpen] = useState(false); return (