11---
2+ import HeaderLogo from " ./HeaderLogo.astro" ;
3+ import NavLink from " ./NavLink.astro" ;
24import {
35 meetupURL ,
46 getStartedURL ,
@@ -7,46 +9,47 @@ import {
79 donateURL ,
810 projectsURL ,
911} from " @/utils/urls" ;
10- import HeaderLogo from " @/components/HeaderLogo.astro" ;
1112
13+ const activeClass = " text-muted relative after:content-[''] after:absolute after:left-0 after:top-[calc(1em+.2rem)] after:w-2 after:h-1 after:bg-primary" ;
1214const routes = [
13- { label: " Join " , href: getStartedURL },
15+ { label: " Get Started " , href: getStartedURL },
1416 { label: " Events" , href: meetupURL },
1517 { label: " Projects" , href: projectsURL },
1618 { label: " Blog" , href: blogURL },
1719 { label: " About" , href: aboutURL },
1820 { label: " Donate" , href: donateURL , highlight: true }
1921];
20-
2122---
2223
2324<header class =" w-full bg-white" >
24- <div class =" max-w-[920px] mx-auto px-4 py-4 flex justify-between items-center" >
25- <a href =" /" class = " flex items-center " >
25+ <nav class =" py-4 flex justify-between items-center" >
26+ <NavLink href =" /" >
2627 <HeaderLogo />
27- </a >
28- <nav >
29- <div class =" hidden md:flex items-center space-x-6" >
28+ </NavLink >
29+ <ul class =" hidden md:flex items-center space-x-6" >
3030 { routes .map ((route ) => (
31- <a
32- href = { route .href }
33- class = { ` no-underline hover:underline text-lg transition-colors ${
34- route .highlight
35- ? " bg-[var(--color-sf-red)] text-white px-4 py-2 rounded-lg hover:bg-[#d54d4b]"
36- : " text-gray-800 hover:text-[var(--color-sf-red)]"
37- } ` }
38- >
39- { route .label }
40- </a >
31+ <li >
32+ <NavLink
33+ href = { route .href }
34+ class :list = { [
35+ " font-condensed font-semibold text-lg text-stone-800" ,
36+ route .highlight && " bg-primary text-white px-4 py-2 rounded-lg hover:bg-[#d54d4b] hover:no-underline"
37+ ]}
38+ activeClass = { activeClass }
39+ >
40+ { route .label }
41+ </NavLink >
42+ </li >
4143 ))}
42- </div >
43- <button class =" md:hidden text-gray-800" id =" mobile-menu-button" >
44- <svg xmlns =" http://www.w3.org/2000/svg" class =" h-6 w-6" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
45- <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 6h16M4 12h16M4 18h16" />
46- </svg >
47- </button >
48- </nav >
49- </div >
44+ <li >
45+ <button class =" md:hidden text-stone-800" id =" mobile-menu-button" >
46+ <svg xmlns =" http://www.w3.org/2000/svg" class =" h-6 w-6" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
47+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 6h16M4 12h16M4 18h16" />
48+ </svg >
49+ </button >
50+ </li >
51+ </ul >
52+ </nav >
5053 <!-- Mobile menu -->
5154 <div class =" md:hidden hidden bg-white w-full absolute" id =" mobile-menu" >
5255 <div class =" px-4 py-2 space-y-2" >
@@ -56,7 +59,7 @@ const routes = [
5659 class = { ` block font-[var(--font-barlow)] font-bold text-lg py-2 ${
5760 route .highlight
5861 ? " text-[var(--color-sf-red)]"
59- : " text-gray -800"
62+ : " text-stone -800"
6063 } ` }
6164 >
6265 { route .label }
0 commit comments