diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 02c97f98..22931d4f 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -7,3 +7,4 @@ const dashboard = () => { }; export default dashboard; + diff --git a/src/app/components/Sidebar.tsx b/src/app/components/Sidebar.tsx index a41b4542..7b7f42d1 100644 --- a/src/app/components/Sidebar.tsx +++ b/src/app/components/Sidebar.tsx @@ -35,11 +35,13 @@ const Sidebar = () => { icon: , current: `/${segement}` === "/events" ? true : false, }, + ]; return (
{isCollapsed ? ( @@ -57,7 +59,7 @@ const Sidebar = () => { className={`${option.current ? style.currentOption : ""}`} > -
+
{option.icon}

{isCollapsed ? "" : option.name}

diff --git a/src/app/components/Sidebar_Guest.tsx b/src/app/components/Sidebar_Guest.tsx new file mode 100644 index 00000000..8443cc1e --- /dev/null +++ b/src/app/components/Sidebar_Guest.tsx @@ -0,0 +1,87 @@ +"use client"; +import { useSelectedLayoutSegment } from "next/navigation"; +import { useState } from "react"; +import Link from "next/link"; +import style from "@styles/admin/sidebar.module.css"; +import { + Bars3Icon, + XMarkIcon, + HomeIcon, + CalendarDaysIcon, + UserIcon, + HandRaisedIcon +} from "@heroicons/react/16/solid"; + +const Sidebar = () => { + // returns the current route that user is on, null if user is on the root (admin page.tsx) + const segement = useSelectedLayoutSegment(); + + // useState 1ining if slider is collapased + const [isCollapsed, setCollapsed] = useState(false); + + const toggleSlider = () => { + setCollapsed(!isCollapsed); + }; + + // can add more options here for admin + const sideBarOptions = [ + { + name: "Home", + href: "/dashboard", + icon: , + current: !segement ? true : false, + }, + { + name: "Events", + href: "/dashboard/events", + icon: , + current: `/${segement}` === "/events" ? true : false, + }, + { + name: "Volunteer", + href: "/dashboard/volunteer", + icon: , + current: `/${segement}` === "/volunteer" ? true : false, + }, + { + name: "Profile", + href: "/dashboard/profile", + icon: , + current: `/${segement}` === "/profile" ? true : false, + }, + ]; + + return ( +
+
+ {isCollapsed ? ( + + ) : ( + + )} +
+
+
    + {sideBarOptions.map((option) => ( +
  • + +
    + {option.icon} +

    {isCollapsed ? "" : option.name}

    +
    + +
  • + ))} +
+
+
+ ); +}; + +export default Sidebar; diff --git a/src/app/dashboard/events/page.tsx b/src/app/dashboard/events/page.tsx new file mode 100644 index 00000000..4ac12688 --- /dev/null +++ b/src/app/dashboard/events/page.tsx @@ -0,0 +1,9 @@ +const dashboard = () => { + return ( +
+

Event Guest Page

+
+ ); +}; + +export default dashboard; diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx new file mode 100644 index 00000000..88437362 --- /dev/null +++ b/src/app/dashboard/layout.tsx @@ -0,0 +1,25 @@ +import { ReactNode } from "react"; +import { Montserrat } from "next/font/google"; +import Sidebar from "@components/Sidebar_Guest"; +import style from "@styles/admin/layout.module.css"; + +type Props = { + children: ReactNode; +}; + +const montserrat = Montserrat({ subsets: ["latin"], weight: ["300"] }); + +const Layout = (props: Props) => { + return ( +
+
+
+ +
+
{props.children}
+
+
+ ); +}; + +export default Layout; diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx new file mode 100644 index 00000000..01196f58 --- /dev/null +++ b/src/app/dashboard/page.tsx @@ -0,0 +1,10 @@ +const dashboard = () => { + return ( +
+

Main Guest Dashboard

+
+ ); +}; + +export default dashboard; + diff --git a/src/app/dashboard/profile/page.tsx b/src/app/dashboard/profile/page.tsx new file mode 100644 index 00000000..1eb1745c --- /dev/null +++ b/src/app/dashboard/profile/page.tsx @@ -0,0 +1,10 @@ +const dashboard = () => { + return ( +
+

Profile Guest Page

+
+ ); + }; + + export default dashboard; + \ No newline at end of file diff --git a/src/app/dashboard/volunteer/page.tsx b/src/app/dashboard/volunteer/page.tsx new file mode 100644 index 00000000..439610bc --- /dev/null +++ b/src/app/dashboard/volunteer/page.tsx @@ -0,0 +1,10 @@ +const dashboard = () => { + return ( +
+

Volunteer Guest Page

+
+ ); + }; + + export default dashboard; + \ No newline at end of file diff --git a/src/app/styles/admin/layout.module.css b/src/app/styles/admin/layout.module.css index 31b4e2c6..47560d4b 100644 --- a/src/app/styles/admin/layout.module.css +++ b/src/app/styles/admin/layout.module.css @@ -1,9 +1,10 @@ .adminDash { - display: flex; + display: flex; } .mainContainer { - width: 100%; - text-align: center; - height: 100vh; + padding-top: 50px; + width: 100%; + text-align: center; + height: 100vh; } diff --git a/src/app/styles/admin/sidebar.module.css b/src/app/styles/admin/sidebar.module.css index f15601b2..bc4d2898 100644 --- a/src/app/styles/admin/sidebar.module.css +++ b/src/app/styles/admin/sidebar.module.css @@ -1,4 +1,4 @@ -/* common style for collapsed and non-callapsed */ +/* common style for collapsed and non-collapsed */ .sidebar { width: 225px; height: 100vh; @@ -20,20 +20,45 @@ list-style: none; } +.adminOptions li:hover { + background-color: #3498db; /* Lighter color on hover */ +} + .adminOptions ul li a { color: black; text-decoration: none; } -.adminOptions ul li:hover { - background-color: #f0f0f0; +.option { + padding: 10px; + margin: 0 10px; + padding: 30px 0; + position: relative; + z-index: 1; + display: flex; + flex-direction: row; + transition: color 0.3s; + cursor: pointer; +} + +.option p { + margin-left: 10px; } -.adminOptions p { - font-size: 1.5vh; - text-align: center; - padding-top: 9px; - padding-left: 15px; +.option:hover { + color: white; /* Text color on hover */ +} + +.currentOption { + background-color: #3498db; +} + +.toggleButton { + display: inline-block; + margin-top: 20px; + margin-left: 80%; + text-align: right; + cursor: pointer; } /* when slider is collapsed */ @@ -61,44 +86,16 @@ /* option button */ .option { - padding: 10px; - margin: 0 10px; - padding: 30px 0; - position: relative; - z-index: 1; - display: flex; - flex-direction: row; - transition: color 0.3s; + font-weight: normal; /* Reset font weight on regular state */ } .option:hover { font-weight: bold; } -.currentOption { - background-color: #f0f0f0; -} - -.toggleButton { - display: inline-block; - margin-top: 20px; - margin-left: 80%; - text-align: right; - cursor: pointer; -} - /* mobile view */ @media (max-width: 768px) { - .sidebar { - width: 45vw; - text-align: center; - } - .collapsedSidebar { - width: 40px; - padding-left: 10px; - overflow: hidden; - height: 60px; box-shadow: 0px 0 0px rgba(0, 0, 0, 0.1); } }