Add player leaderboard and homepage preview
This commit is contained in:
31
components/SiteNav.tsx
Normal file
31
components/SiteNav.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
const links = [
|
||||
["/servers", "Play & maps"],
|
||||
["/leaderboard", "Leaderboard"],
|
||||
["/downloads", "Downloads"],
|
||||
["/about", "Guide"],
|
||||
] as const;
|
||||
|
||||
export function SiteNav() {
|
||||
const pathname = usePathname();
|
||||
return (
|
||||
<nav aria-label="Main navigation">
|
||||
{links.map(([href, label]) => (
|
||||
<Link
|
||||
key={href}
|
||||
href={href}
|
||||
aria-current={
|
||||
pathname === href || pathname.startsWith(`${href}/`)
|
||||
? "page"
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user