This commit is contained in:
+12
-3
@@ -18,15 +18,17 @@ function NavLink({
|
||||
title?: string;
|
||||
}) {
|
||||
const pathname = usePathname();
|
||||
const active = pathname === href;
|
||||
const active = pathname === href || pathname.startsWith(href + '/');
|
||||
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
title={title}
|
||||
className={[
|
||||
"text-xs font-medium transition-colors",
|
||||
active ? "text-zinc-100" : "text-zinc-400 hover:text-zinc-100",
|
||||
"relative text-xs font-medium transition-colors pb-0.5",
|
||||
active
|
||||
? "text-zinc-100 after:absolute after:bottom-0 after:left-0 after:right-0 after:h-px after:bg-amber-400"
|
||||
: "text-zinc-400 hover:text-zinc-100",
|
||||
].join(" ")}
|
||||
>
|
||||
{children}
|
||||
@@ -55,6 +57,13 @@ export function TopNav() {
|
||||
/>
|
||||
</Link>
|
||||
|
||||
{/* Centre: primary nav links */}
|
||||
<nav className="hidden sm:flex items-center gap-5">
|
||||
<NavLink href="/builder">Builder</NavLink>
|
||||
<NavLink href="/guides">Guides</NavLink>
|
||||
<NavLink href="/builds">Community</NavLink>
|
||||
</nav>
|
||||
|
||||
{/* Right side actions */}
|
||||
<div className="flex items-center justify-end gap-3 sm:gap-4">
|
||||
<ThemeToggle />
|
||||
|
||||
Reference in New Issue
Block a user