import { useState, useEffect } from 'react' import { Sheet, SheetTrigger, SheetContent, SheetTitle } from '@/components/ui/Sheet' import * as VisuallyHidden from '@radix-ui/react-visually-hidden' import { Link, useLocation } from 'react-router-dom' const Header = () => { const [isScrolled, setIsScrolled] = useState(false) const [mobileMenuOpen, setMobileMenuOpen] = useState(false) const [openDropdown, setOpenDropdown] = useState(null) const location = useLocation() useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 10) } window.addEventListener('scroll', handleScroll) return () => window.removeEventListener('scroll', handleScroll) }, []) useEffect(() => { setOpenDropdown(null) }, [location.pathname]) const navLinks = [ { name: 'Home', href: '/' }, { name: 'Services', href: '/services' }, { name: 'Industries', href: '/industries' }, { name: 'About', href: '/about' }, { name: 'Contact', href: '/contact' }, { name: 'Support', href: '/support' }, ] const serviceLinks = [ { name: 'Unified Communications', href: '/services/unified-communications' }, { name: 'Contact Center', href: '/services/contact-center' }, { name: 'Managed Support', href: '/services/managed-support' }, { name: 'Consulting & Training', href: '/services/consulting-training' }, { name: 'Infrastructure Cabling', href: '/services/infrastructure-cabling' }, { name: 'Wireless Access', href: '/services/wireless-access' }, { name: 'Local Networking', href: '/services/local-networking' }, ] const industryLinks = [ { name: 'Healthcare', href: '/industries/healthcare' }, { name: 'Retail', href: '/industries/retail' }, { name: 'Manufacturing', href: '/industries/manufacturing' }, { name: 'Education & Finance', href: '/industries/education-finance' }, ] const closeMobileMenu = () => setMobileMenuOpen(false) const closeDropdown = () => setOpenDropdown(null) const isActive = (href) => location.pathname === href return (
{/* Logo */}
Queue North Technologies Queue North Technologies
{/* Desktop Nav */} {/* The desktop row starts at lg, not md. Tightening the gaps at md (#214) did not fix iPad portrait, it only hid the overflow better: measured at a true 768px the three items want 787px of their natural width against 736px of container, so flex shrank the CTA to 114px, wrapped "Request Consultation" inside it, and still pushed it 25px past the viewport, where body{overflow-x:hidden} sliced it off with no scrollbar. That gap-4 was verified in a desktop window whose scrollbar left ~753px, so md never engaged and the fix was never actually exercised. 768 to 1023 gets the menu button instead, which is the better tablet experience anyway: 44px rows rather than 17px ones, and the Services and Industries submenus are reachable, where the desktop dropdowns open on hover and a touch device has no hover. The wordmark stays at text-xl until xl. At exactly 1024 the row was 988px inside 992px of container: four pixels, which a font fallback or one more nav item would eat. At text-xl it has room. */} {/* CTA Button */} {/* shrink-0 and whitespace-nowrap so a row that no longer fits overflows visibly and the device sweep catches it, instead of flex quietly squeezing the button and wrapping its label to keep the total inside a viewport it is already past. */}
Request Consultation
{/* Mobile Menu */}
{/* p-2.5, so the 24px icon sits in a 44x44 target. It is now the only navigation up to 1023px, and 40x40 was under the mark. */} Navigation Menu {/* Logo + phone */}
Queue North Technologies Queue North Technologies
{/* Scrollable nav */} {/* CTA */}
Get a Free Quote
) } export default Header