|
| 1 | +import { siteConfig } from "../../config/navbarHero"; |
| 2 | +import Button from "../shared/Button"; |
| 3 | +import { useState } from "react"; |
| 4 | + |
| 5 | +export default function Navbar() { |
| 6 | + const [mobileMenuOpen, setMobileMenuOpen] = useState(false); |
| 7 | + |
| 8 | + return ( |
| 9 | + <header className="bg-white w-full px-0 min-[900px]:sticky fixed top-0 left-0 z-50 "> |
| 10 | + <div className="max-w-[1920px] w-screen mx-auto px-4 sm:px-6 md:px-8 lg:px-10 py-3 flex items-center text-black font-['Helvetica'] font-normal text-[20px] leading-[100%] tracking-[-0.015em]"> |
| 11 | + <div className="flex items-center space-x-3 min-[900px]:space-x-6 flex-shrink-0"> |
| 12 | + <img |
| 13 | + src={siteConfig.navigation.logo} |
| 14 | + alt="Logo" |
| 15 | + className="h-10 w-auto" |
| 16 | + /> |
| 17 | + </div> |
| 18 | + |
| 19 | + <nav |
| 20 | + className="hidden min-[900px]:flex flex-grow justify-center space-x-6" |
| 21 | + style={{ letterSpacing: "-1.5%" }} |
| 22 | + > |
| 23 | + {siteConfig.navigation.links.map((item) => ( |
| 24 | + <a |
| 25 | + key={item.name} |
| 26 | + href={item.href} |
| 27 | + className="transition-colors hover:text-[rgba(55,115,236,1)]" |
| 28 | + > |
| 29 | + {item.name} |
| 30 | + </a> |
| 31 | + ))} |
| 32 | + </nav> |
| 33 | + |
| 34 | + <div className="hidden min-[900px]:flex items-center space-x-4 text-sm flex-shrink-0"> |
| 35 | + <Button className="border border-black bg-white text-black px-3 py-1.5 text-sm transition-colors hover:bg-blue-50 hover:border-blue-600"> |
| 36 | + Join Us |
| 37 | + </Button> |
| 38 | + <Button className="bg-[rgba(6,25,70,1)] text-white px-3 py-1.5 text-sm transition-colors hover:bg-[rgba(6,25,70,0.8)]"> |
| 39 | + Contact Us |
| 40 | + </Button> |
| 41 | + </div> |
| 42 | + |
| 43 | + <button |
| 44 | + className="min-[900px]:hidden ml-auto flex items-center" |
| 45 | + onClick={() => setMobileMenuOpen(!mobileMenuOpen)} |
| 46 | + aria-label="Toggle menu" |
| 47 | + > |
| 48 | + <svg |
| 49 | + className="w-8 h-8 text-black" |
| 50 | + fill="none" |
| 51 | + stroke="currentColor" |
| 52 | + viewBox="0 0 24 24" |
| 53 | + xmlns="http://www.w3.org/2000/svg" |
| 54 | + > |
| 55 | + {mobileMenuOpen ? ( |
| 56 | + <path |
| 57 | + strokeLinecap="round" |
| 58 | + strokeLinejoin="round" |
| 59 | + strokeWidth={2} |
| 60 | + d="M6 18L18 6M6 6l12 12" |
| 61 | + /> |
| 62 | + ) : ( |
| 63 | + <path |
| 64 | + strokeLinecap="round" |
| 65 | + strokeLinejoin="round" |
| 66 | + strokeWidth={2} |
| 67 | + d="M4 6h16M4 12h16M4 18h16" |
| 68 | + /> |
| 69 | + )} |
| 70 | + </svg> |
| 71 | + </button> |
| 72 | + </div> |
| 73 | + |
| 74 | + {mobileMenuOpen && ( |
| 75 | + <div className="min-[900px]:hidden fixed inset-0 bg-white px-6 py-6 z-40 overflow-auto"> |
| 76 | + <button |
| 77 | + className="absolute top-6 right-6 text-black" |
| 78 | + onClick={() => setMobileMenuOpen(false)} |
| 79 | + aria-label="Close menu" |
| 80 | + > |
| 81 | + <svg |
| 82 | + className="w-8 h-8" |
| 83 | + fill="none" |
| 84 | + stroke="currentColor" |
| 85 | + viewBox="0 0 24 24" |
| 86 | + xmlns="http://www.w3.org/2000/svg" |
| 87 | + > |
| 88 | + <path |
| 89 | + strokeLinecap="round" |
| 90 | + strokeLinejoin="round" |
| 91 | + strokeWidth={2} |
| 92 | + d="M6 18L18 6M6 6l12 12" |
| 93 | + /> |
| 94 | + </svg> |
| 95 | + </button> |
| 96 | + |
| 97 | + <nav className="mt-14 flex flex-col space-y-4"> |
| 98 | + {siteConfig.navigation.links.map((item) => ( |
| 99 | + <a |
| 100 | + key={item.name} |
| 101 | + href={item.href} |
| 102 | + className="text-black text-lg font-semibold hover:text-[rgba(55,115,236,1)]" |
| 103 | + onClick={() => setMobileMenuOpen(false)} |
| 104 | + > |
| 105 | + {item.name} |
| 106 | + </a> |
| 107 | + ))} |
| 108 | + </nav> |
| 109 | + |
| 110 | + <div className="mt-6 flex space-x-4 border-t border-border pt-4"> |
| 111 | + <Button className="flex-grow border border-black bg-white text-black px-3 py-2"> |
| 112 | + Join Us |
| 113 | + </Button> |
| 114 | + <Button className="flex-grow bg-[rgba(6,25,70,1)] text-white px-3 py-2"> |
| 115 | + Contact Us |
| 116 | + </Button> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + )} |
| 120 | + </header> |
| 121 | + ); |
| 122 | +} |
0 commit comments