Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

feat: add mobile menu #230

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions components/app-header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { MenuIcon } from "lucide-react";
import { useTranslations } from "next-intl";

import { AppNavLink } from "@/components/app-nav-link";
import { ColorSchemeSwitcher } from "@/components/color-scheme-switcher";
import type { LinkProps } from "@/components/link";
import { LocaleSwitcher } from "@/components/locale-switcher";
import { Logo } from "@/components/logo";
import { IconButton } from "@/components/ui/icon-button";
import { createHref } from "@/lib/create-href";

export function AppHeader() {
Expand All @@ -18,8 +20,8 @@ export function AppHeader() {

return (
<header className="border-b">
<div className="container flex max-w-screen-md items-center justify-between gap-x-4 border-x bg-neutral-0 py-6 dark:bg-neutral-900">
<nav aria-label={t("navigation-primary")}>
<div className="container flex max-w-screen-md items-center justify-between gap-x-4 border-x bg-neutral-0 py-3 xs:py-6 dark:bg-neutral-900">
<nav aria-label={t("navigation-primary")} className="hidden xs:block">
<ul className="-ml-3 flex items-center gap-x-2 text-sm font-medium" role="list">
{Object.entries(links).map(([id, link]) => {
if (id === "home") {
Expand All @@ -42,9 +44,14 @@ export function AppHeader() {
</ul>
</nav>

<div className="-mr-1 flex items-center gap-x-2">
<div className="-mr-1 ml-auto flex items-center gap-x-2">
<ColorSchemeSwitcher />
<LocaleSwitcher />
<nav aria-label={t("navigation-primary")} className="block xs:hidden">
<IconButton variant="plain">
<MenuIcon className="size-5 shrink-0" />
</IconButton>
</nav>
</div>
</div>
</header>
Expand Down