1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 19:35:27 -04:00
Files
jarv.is/components/layout/menu.tsx
T
jake 5a3c7b9613 refactor: redesign home page, remove old video pages, migrate to @tailwindcss/typography
- Replace root page with new (home) route featuring a project showcase (Domainstack, Sofa, Versioneer, Snoozle)
- Remove /birthday and /hillary video pages
- Replace custom hand-rolled .prose styles with @tailwindcss/typography via a .markdown utility class
- Remove heading-anchor component and .nvmrc
2026-04-08 15:00:49 -04:00

47 lines
1.0 KiB
TypeScript

"use client";
import Link from "next/link";
import { useSelectedLayoutSegment } from "next/navigation";
import { Button } from "@/components/ui/button";
const menuItems = [
{
text: "Notes",
href: "/notes",
},
{
text: "Projects",
href: "/projects",
},
] as const;
const Menu = () => {
const segment = useSelectedLayoutSegment() || "";
return (
<nav data-slot="navigation-menu" className="flex items-center gap-2">
{menuItems.map((item) => {
const isCurrent = item.href?.split("/")[1] === segment;
return (
<Button
key={item.href}
variant="ghost"
size="sm"
nativeButton={false}
aria-label={item.text}
data-current={isCurrent || undefined}
className="data-current:bg-accent/60 data-current:text-accent-foreground text-sm leading-none"
render={<Link href={item.href} />}
>
{item.text}
</Button>
);
})}
</nav>
);
};
export { Menu };