@devries-cameron20 / OCIU-npo Mirror · read-only
Fork 0

Mirrored from https://github.com/Camo67/OCIU-npo.git

Synced Nov 21, 03:37 UTC

1 import { useState } from "react";
2 import { Button } from "@/components/ui/button";
3 import logoBanner from "@/assets/logo-banner.webp";
4 import { Menu, X } from "lucide-react";
5 const navItems = [{
6 label: "Mission",
7 href: "#mission"
8 }, {
9 label: "Leadership",
10 href: "#leadership"
11 }, {
12 label: "Podcast",
13 href: "#podcast"
14 }, {
15 label: "Services",
16 href: "#services"
17 }, {
18 label: "Get Involved",
19 href: "#join"
20 }];
21 export const Navigation = () => {
22 const [isOpen, setIsOpen] = useState(false);
23 return <nav className="fixed top-0 left-0 right-0 z-50 border-b border-border shadow-sm bg-blue-700">
24 <div className="container mx-auto px-4">
25 <div className="flex items-center justify-between h-16">
26 {/* Logo */}
27 <a href="/" className="flex items-center">
28 <img src={logoBanner} width={390} height={144} alt="Community & Unity" className="h-12 w-auto" />
29 </a>
30
31 {/* Desktop Navigation */}
32 <div className="hidden md:flex items-center gap-6">
33 {navItems.map(item => <a key={item.label} href={item.href} className="text-primary-foreground hover:text-white transition-colors font-medium">
34 {item.label}
35 </a>)}
36 </div>
37
38 {/* Mobile Menu Button */}
39 <Button aria-label={isOpen ? "Close navigation" : "Open navigation"} aria-expanded={isOpen} aria-controls="mobile-navigation" variant="ghost" size="icon" className="md:hidden" onClick={() => setIsOpen(!isOpen)}>
40 {isOpen ? <X /> : <Menu />}
41 </Button>
42 </div>
43
44 {/* Mobile Navigation */}
45 {isOpen && <div id="mobile-navigation" className="md:hidden py-4 space-y-3 border-t border-border">
46 {navItems.map(item => <a key={item.label} href={item.href} className="block py-2 text-primary-foreground hover:text-white transition-colors font-medium" onClick={() => setIsOpen(false)}>
47 {item.label}
48 </a>)}
49 </div>}
50 </div>
51 </nav>;
52 };