mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 03:47:45 +01:00
* fix(nav): every header control is a 44px target The fleet render sweep (nav contract rule 3) counted 18 sub-44px controls in the desktop header: text-sm links 20px tall, Get Started 36px, Register 38px, the Professionals menu button 20px. Fixed in the shared pieces (NavItem, AuthNav, the hamburger, the mobile drawer) with min-h-11 on the control; the header stays h-16 and the text size is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> * fix(nav): short header links are 44px wide too About and Login cleared 44px tall but were 41 and 39px wide. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> --------- Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
63 lines
2.0 KiB
TypeScript
63 lines
2.0 KiB
TypeScript
'use client';
|
|
|
|
import { useState } from 'react';
|
|
import { usePathname } from 'next/navigation';
|
|
import { NavItem, MobileNav, AuthNav } from './navigation';
|
|
import { MenuIcon } from './icons';
|
|
import { menuItems, getNavItems, getButtonItems } from '@/data/menuItems';
|
|
|
|
/**
|
|
* Main site navigation component
|
|
* Renders desktop megamenu navigation and mobile drawer
|
|
*
|
|
* Architecture:
|
|
* - NavItem: Handles individual nav items (links, dropdowns, buttons)
|
|
* - MobileNav: Handles mobile drawer navigation
|
|
* - menuItems: SSOT for navigation structure
|
|
*/
|
|
export function Navigation() {
|
|
const pathname = usePathname();
|
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
|
|
const navItems = getNavItems();
|
|
const buttonItems = getButtonItems();
|
|
|
|
return (
|
|
<>
|
|
{/* Desktop Navigation */}
|
|
<nav className="hidden lg:flex items-center space-x-8">
|
|
<div className="flex-1 flex items-center space-x-8">
|
|
{navItems.map((item) => (
|
|
<NavItem key={item.label} item={item} isActive={pathname === item.path} />
|
|
))}
|
|
</div>
|
|
<div className="flex-shrink-0 flex items-center gap-4">
|
|
{buttonItems.map((item) => (
|
|
<NavItem key={item.label} item={item} isActive={pathname === item.path} />
|
|
))}
|
|
<div className="h-6 w-px bg-gray-200" />
|
|
<AuthNav />
|
|
</div>
|
|
</nav>
|
|
|
|
{/* Mobile Menu Button */}
|
|
<button
|
|
type="button"
|
|
className="lg:hidden inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-gray-600 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-action"
|
|
onClick={() => setMobileMenuOpen(true)}
|
|
aria-label="Open menu"
|
|
>
|
|
<MenuIcon className="h-6 w-6" />
|
|
</button>
|
|
|
|
{/* Mobile Navigation Drawer */}
|
|
<MobileNav
|
|
isOpen={mobileMenuOpen}
|
|
onClose={() => setMobileMenuOpen(false)}
|
|
items={menuItems}
|
|
currentPath={pathname ?? ''}
|
|
/>
|
|
</>
|
|
);
|
|
}
|