import { A, useLocation } from '@solidjs/router'; import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js'; const isRouteActive = (pathname: string, href: string) => { if (href === '/') return pathname === '/'; if (href === '/help-center') return pathname === '/help-center' || pathname.startsWith('/help-center/'); return pathname === href; }; export default function PublicHeader() { const location = useLocation(); const [scrolled, setScrolled] = createSignal(false); const [mobileOpen, setMobileOpen] = createSignal(false); onMount(() => { const onScroll = () => setScrolled(window.scrollY > 10); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); onCleanup(() => window.removeEventListener('scroll', onScroll)); }); createEffect(() => { location.pathname; setMobileOpen(false); }); return (
); }