'use client'; import { useEffect, useRef, useState } from 'react'; import { RiCloseLine, RiMenuLine } from '@remixicon/react'; import { Logo } from '@/components/site/logo'; import { Sheet, SheetClose, SheetContent, SheetDescription, SheetTitle, SheetTrigger, } from '@/components/ui/sheet'; export type NavigationItem = { label: string; href: string; description: string; }; export function MobileNavigation({ items }: { items: NavigationItem[] }) { const [open, setOpen] = useState(false); const navigating = useRef(false); useEffect(() => { const desktop = window.matchMedia('(min-width: 768px)'); const closeOnDesktop = () => { if (desktop.matches) setOpen(false); }; desktop.addEventListener('change', closeOnDesktop); return () => desktop.removeEventListener('change', closeOnDesktop); }, []); return ( { // Let the anchor move focus to its section without the trigger // interrupting the page's smooth scroll when the sheet closes. if (navigating.current) event.preventDefault(); navigating.current = false; }} >
Explore Vertex Explore our products, solutions, resources, documentation, and pricing.
{ navigating.current = true; }} className="flex h-12 items-center justify-center rounded-full bg-white px-4 text-sm font-medium text-black transition-colors hover:bg-white/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30 focus-visible:ring-offset-2 focus-visible:ring-offset-black" > Sign Up { navigating.current = true; }} className="flex h-12 items-center justify-center rounded-full border border-white/10 px-4 text-sm font-medium text-white/70 transition-colors hover:bg-white/5 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30" > Log In
); }