1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 20:15:31 -04:00

minor style tweaks

This commit is contained in:
2025-05-05 12:55:12 -04:00
parent 5058382f71
commit 27e6ca2a4b
64 changed files with 571 additions and 551 deletions
+35
View File
@@ -0,0 +1,35 @@
"use client";
import { useSelectedLayoutSegment } from "next/navigation";
import MenuItem from "@/components/layout/menu-item";
import ThemeToggle from "@/components/layout/theme-toggle";
import { cn } from "@/lib/utils";
import { menuItems } from "@/lib/config/menu";
import type { ComponentPropsWithoutRef } from "react";
const Menu = ({ className, ...rest }: ComponentPropsWithoutRef<"ul">) => {
const segment = useSelectedLayoutSegment() || "";
return (
<ul className={cn("flex max-w-2/3 flex-row justify-between md:max-w-none md:justify-end", className)} {...rest}>
{menuItems.map((item) => {
const isCurrent = item.href === `/${segment}`;
return (
<li className="max-sm:first-of-type:hidden md:ml-4" key={item.href}>
<MenuItem {...item} current={isCurrent} />
</li>
);
})}
<li className="-mr-2.5 md:ml-4">
<MenuItem
// @ts-ignore
icon={ThemeToggle}
/>
</li>
</ul>
);
};
export default Menu;