fix: correct mobile navigation layout

This commit is contained in:
2026-10-11 10:59:37 +08:00
parent 607dcdd660
commit 6b12546d06
2 changed files with 70 additions and 3 deletions
+5 -3
View File
@@ -1,5 +1,6 @@
import Link from "next/link";
import { getNavigationMenu } from "@/services/navigation.service";
import MobileNavigation from "./MobileNavigation";
const fallbackNavItems = [
{ title: "首页", href: "/" },
@@ -24,15 +25,15 @@ export default async function Header() {
return (
<header className="sticky top-0 z-50 border-b border-slate-100 bg-white/80 backdrop-blur">
<div className="mx-auto flex h-16 max-w-7xl items-center justify-between px-6">
<Link href="/" className="text-xl font-bold text-primary">
<Link href="/" className="shrink-0 whitespace-nowrap text-xl font-bold text-primary">
企业官网
</Link>
<nav className="flex gap-8">
<nav aria-label="主导航" className="hidden items-center gap-6 md:flex lg:gap-8">
{navItems.map((item) => (
<Link
key={item.href}
href={item.href}
className="text-slate-700"
className="whitespace-nowrap text-slate-700"
target={item.newTab ? "_blank" : undefined}
rel={item.newTab ? "noreferrer" : undefined}
>
@@ -40,6 +41,7 @@ export default async function Header() {
</Link>
))}
</nav>
<MobileNavigation items={navItems} />
</div>
</header>
);