diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 13378a3..8b795be 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,22 +1,58 @@ import { cn } from "@/lib/utils"; +import { useEffect, useState } from "react"; + +interface NavbarProps { + currentPath?: string; +} + +export default function Navbar({ currentPath: initialPath = "" }: NavbarProps) { + const [currentPath, setCurrentPath] = useState(initialPath); + + useEffect(() => { + // Get current path on client-side if not provided or for client-side navigation + if (!initialPath) { + setCurrentPath(window.location.pathname); + } + }, [initialPath]); -export default function Navbar() { return ( <>
- Resist Tech Monopolies + + Resist Tech Monopolies +
- + Get Involved - + {/* */} + Points of Unity - + {/* */} + What We're Working On @@ -25,8 +61,8 @@ export default function Navbar() {
{[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - ].map(() => ( - <> + ].map((key) => ( +
people icon - +
))}
diff --git a/src/pages/GetInvolved.astro b/src/pages/GetInvolved.astro index c1ec974..7e5a3af 100644 --- a/src/pages/GetInvolved.astro +++ b/src/pages/GetInvolved.astro @@ -3,12 +3,15 @@ import Navbar from "../components/Navbar"; import Footer from "../components/Footer"; import Layout from "../layouts/Layout.astro"; import "../styles/globals.css"; + +// Get current path from Astro +const currentPath = Astro.url.pathname; ---
- +

Get Involved

diff --git a/src/pages/PointsOfUnity.astro b/src/pages/PointsOfUnity.astro index 92a2b13..de8f17a 100644 --- a/src/pages/PointsOfUnity.astro +++ b/src/pages/PointsOfUnity.astro @@ -3,12 +3,15 @@ import Navbar from "../components/Navbar"; import Footer from "../components/Footer"; import Layout from "../layouts/Layout.astro"; import "../styles/globals.css"; + +// Get current path from Astro +const currentPath = Astro.url.pathname; ---
- +

Points of Unity

diff --git a/src/pages/WhatWereWorkingOn.astro b/src/pages/WhatWereWorkingOn.astro index aace435..b290b8a 100644 --- a/src/pages/WhatWereWorkingOn.astro +++ b/src/pages/WhatWereWorkingOn.astro @@ -3,12 +3,15 @@ import Navbar from "../components/Navbar"; import Footer from "../components/Footer"; import Layout from "../layouts/Layout.astro"; import "../styles/globals.css"; + +// Get current path from Astro +const currentPath = Astro.url.pathname; ---

- +

What We're Working On

Pihole Workshop

diff --git a/src/pages/index.astro b/src/pages/index.astro index 41d7711..a69633a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -3,12 +3,15 @@ import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; import Layout from "@/layouts/Layout.astro"; import "@/styles/globals.css"; + +// Get current path from Astro +const currentPath = Astro.url.pathname; ---
- +