Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4add70c577 |
@ -1,22 +1,58 @@
|
|||||||
import { cn } from "@/lib/utils";
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={cn("flex flex-row justify-between pb-8 pl-4 pr-4 pt-8")}>
|
<div className={cn("flex flex-row justify-between pb-8 pl-4 pr-4 pt-8")}>
|
||||||
<div>
|
<div>
|
||||||
<strong className={cn("sm:text-2xl md:text-4xl")}>
|
<strong className={cn("sm:text-2xl md:text-4xl")}>
|
||||||
<a href="/">Resist Tech Monopolies</a>
|
<a href="/">
|
||||||
|
Resist Tech Monopolies
|
||||||
|
</a>
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
<strong className={cn("sm:text-1xl flex gap-4 md:text-4xl")}>
|
<strong className={cn("sm:text-1xl flex gap-4 md:text-4xl")}>
|
||||||
<a href="/GetInvolved/" className={cn("text-blue-500")}>
|
<a
|
||||||
|
href="/GetInvolved/"
|
||||||
|
className={cn(
|
||||||
|
"text-blue-500",
|
||||||
|
currentPath.includes("GetInvolved") && "border-b-2 border-blue-500"
|
||||||
|
)}
|
||||||
|
>
|
||||||
Get Involved
|
Get Involved
|
||||||
</a>
|
</a>
|
||||||
<a href="/PointsOfUnity/" className={cn("text-green-500")}>
|
{/* <Separator orientation="vertical" className="w-5" /> */}
|
||||||
|
<a
|
||||||
|
href="/PointsOfUnity/"
|
||||||
|
className={cn(
|
||||||
|
"text-green-500",
|
||||||
|
currentPath.includes("PointsOfUnity") && "border-b-2 border-green-500"
|
||||||
|
)}
|
||||||
|
>
|
||||||
Points of Unity
|
Points of Unity
|
||||||
</a>
|
</a>
|
||||||
<a href="/WhatWereWorkingOn/" className={cn("text-red-500")}>
|
{/* <Separator orientation="vertical" className="w-5" /> */}
|
||||||
|
<a
|
||||||
|
href="/WhatWereWorkingOn/"
|
||||||
|
className={cn(
|
||||||
|
"text-red-500",
|
||||||
|
currentPath.includes("WhatWereWorkingOn") && "border-b-2 border-red-500"
|
||||||
|
)}
|
||||||
|
>
|
||||||
What We're Working On
|
What We're Working On
|
||||||
</a>
|
</a>
|
||||||
</strong>
|
</strong>
|
||||||
@ -25,8 +61,8 @@ export default function Navbar() {
|
|||||||
<div className={cn("flex flex-row justify-between pb-8")}>
|
<div className={cn("flex flex-row justify-between pb-8")}>
|
||||||
{[
|
{[
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||||
].map(() => (
|
].map((key) => (
|
||||||
<>
|
<div key={key}>
|
||||||
<a
|
<a
|
||||||
href="https://www.flaticon.com/free-icons/computer"
|
href="https://www.flaticon.com/free-icons/computer"
|
||||||
title="computer icons"
|
title="computer icons"
|
||||||
@ -40,12 +76,12 @@ export default function Navbar() {
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
href="https://www.flaticon.com/free-icons/people"
|
href="https://www.flaticon.com/free-icons/peopler"
|
||||||
title="people icons"
|
title="people icons"
|
||||||
>
|
>
|
||||||
<img src="/people.png" alt="people icon" width="30" height="30" />
|
<img src="/people.png" alt="people icon" width="30" height="30" />
|
||||||
</a>
|
</a>
|
||||||
</>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
@ -3,12 +3,15 @@ import Navbar from "../components/Navbar";
|
|||||||
import Footer from "../components/Footer";
|
import Footer from "../components/Footer";
|
||||||
import Layout from "../layouts/Layout.astro";
|
import Layout from "../layouts/Layout.astro";
|
||||||
import "../styles/globals.css";
|
import "../styles/globals.css";
|
||||||
|
|
||||||
|
// Get current path from Astro
|
||||||
|
const currentPath = Astro.url.pathname;
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
<main class="flex min-h-screen flex-col justify-between">
|
<main class="flex min-h-screen flex-col justify-between">
|
||||||
<div>
|
<div>
|
||||||
<Navbar />
|
<Navbar client:load currentPath={currentPath} />
|
||||||
<div class="pl-4 pr-4">
|
<div class="pl-4 pr-4">
|
||||||
<h1 class="text-3xl font-semibold">Get Involved</h1>
|
<h1 class="text-3xl font-semibold">Get Involved</h1>
|
||||||
|
|
||||||
|
@ -3,12 +3,15 @@ import Navbar from "../components/Navbar";
|
|||||||
import Footer from "../components/Footer";
|
import Footer from "../components/Footer";
|
||||||
import Layout from "../layouts/Layout.astro";
|
import Layout from "../layouts/Layout.astro";
|
||||||
import "../styles/globals.css";
|
import "../styles/globals.css";
|
||||||
|
|
||||||
|
// Get current path from Astro
|
||||||
|
const currentPath = Astro.url.pathname;
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
<main class="flex min-h-screen flex-col justify-between">
|
<main class="flex min-h-screen flex-col justify-between">
|
||||||
<div>
|
<div>
|
||||||
<Navbar />
|
<Navbar client:load currentPath={currentPath} />
|
||||||
<div class="pl-4 pr-4">
|
<div class="pl-4 pr-4">
|
||||||
<h1 class="text-3xl font-semibold">Points of Unity</h1>
|
<h1 class="text-3xl font-semibold">Points of Unity</h1>
|
||||||
<p>
|
<p>
|
||||||
|
@ -3,12 +3,15 @@ import Navbar from "../components/Navbar";
|
|||||||
import Footer from "../components/Footer";
|
import Footer from "../components/Footer";
|
||||||
import Layout from "../layouts/Layout.astro";
|
import Layout from "../layouts/Layout.astro";
|
||||||
import "../styles/globals.css";
|
import "../styles/globals.css";
|
||||||
|
|
||||||
|
// Get current path from Astro
|
||||||
|
const currentPath = Astro.url.pathname;
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
<main class="flex min-h-screen flex-col justify-between">
|
<main class="flex min-h-screen flex-col justify-between">
|
||||||
<div>
|
<div>
|
||||||
<Navbar />
|
<Navbar client:load currentPath={currentPath} />
|
||||||
<div class="pl-4 pr-4">
|
<div class="pl-4 pr-4">
|
||||||
<h1 class="text-3xl font-semibold">What We're Working On</h1>
|
<h1 class="text-3xl font-semibold">What We're Working On</h1>
|
||||||
<p>Pihole Workshop</p>
|
<p>Pihole Workshop</p>
|
||||||
|
@ -3,12 +3,15 @@ import Navbar from "@/components/Navbar";
|
|||||||
import Footer from "@/components/Footer";
|
import Footer from "@/components/Footer";
|
||||||
import Layout from "@/layouts/Layout.astro";
|
import Layout from "@/layouts/Layout.astro";
|
||||||
import "@/styles/globals.css";
|
import "@/styles/globals.css";
|
||||||
|
|
||||||
|
// Get current path from Astro
|
||||||
|
const currentPath = Astro.url.pathname;
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
<main class="flex min-h-screen flex-col justify-between">
|
<main class="flex min-h-screen flex-col justify-between">
|
||||||
<div>
|
<div>
|
||||||
<Navbar />
|
<Navbar client:load currentPath={currentPath} />
|
||||||
|
|
||||||
<div class="pl-4 pr-4">
|
<div class="pl-4 pr-4">
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user