diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 8af889e..599b18b 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -18,6 +18,7 @@ import { usePathname } from 'next/navigation'; import { NavLink } from './NavLink'; import LanguageSwitcher from './LanguageSwitcher'; import { ContactInfo } from './ContactInfo'; +import { throttle } from '@/utils/throttle'; const Header = () => { const t = useTranslations('navigation'); @@ -33,9 +34,9 @@ const Header = () => { // Scroll handler useEffect(() => { - const handleScroll = () => { + const handleScroll = throttle(() => { setScrolled(window.scrollY > 0); - }; + }, 100); window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []);