/* global React, ReactDOM, Icon, Button, TBMark, useLanguage, LanguageToggle */ const { useState, useEffect } = React; function Header({ scrolled, openBooking, scrollTo, active }) { const [menuOpen, setMenuOpen] = useState(false); const { isPortuguese } = useLanguage(); const onLight = scrolled; const fg = onLight ? 'var(--asphalt)' : 'var(--limestone)'; useEffect(() => { if (!menuOpen) return undefined; const previousOverflow = document.body.style.overflow; const onKeyDown = (event) => { if (event.key === 'Escape') setMenuOpen(false); }; document.body.style.overflow = 'hidden'; window.addEventListener('keydown', onKeyDown); return () => { document.body.style.overflow = previousOverflow; window.removeEventListener('keydown', onKeyDown); }; }, [menuOpen]); const navItems = isPortuguese ? [ { id: 'work', label: 'trabalhos', href: 'Projects.html' }, { id: 'about', label: 'sobre' }, { id: 'collections', label: 'coleções' }, { id: 'pricing', label: 'valores' }, { id: 'testimonials', label: 'depoimentos' }, { id: 'contact', label: 'contato' }, ] : [ { id: 'work', label: 'work', href: 'Projects.html' }, { id: 'about', label: 'about' }, { id: 'collections', label: 'collections' }, { id: 'pricing', label: 'pricing' }, { id: 'testimonials', label: 'kind words' }, { id: 'contact', label: 'contact' }, ]; return (
{menuOpen && ReactDOM.createPortal((
tainá borges.
{navItems.map(it => it.href ? ( {it.label} ) : ( ))}
), document.body)}
); } window.Header = Header;