/* Shared chrome: Header + Footer */ const { useAuth, AuthModal, logoutUser } = window; // Smooth scroll to an anchor on the landing page. // If we're NOT on the landing page, navigate to index.html#id first. function smoothNavTo(e, id) { const path = window.location.pathname; const onLanding = path.endsWith('/') || path.endsWith('/index.html') || path === ''; if (!onLanding) { // let the browser follow href="#id" by replacing with full path e.preventDefault(); window.location.href = `index.html#${id}`; return; } const target = document.getElementById(id); if (target) { e.preventDefault(); target.scrollIntoView({ behavior: 'smooth', block: 'start' }); // update hash without re-jumping history.replaceState(null, '', `#${id}`); } } const SiteHeader = ({ active = 'inicio' }) => { const user = useAuth(); const [authOpen, setAuthOpen] = React.useState(false); const [authMode, setAuthMode] = React.useState('login'); const [menuOpen, setMenuOpen] = React.useState(false); const openLogin = () => { setAuthMode('login'); setAuthOpen(true); }; const openRegister = () => { setAuthMode('register'); setAuthOpen(true); }; return ( <>
Bristol Academy
Bristol Academy
Aptis Exam Trainer
{user && (
{menuOpen && ( <>
setMenuOpen(false)} style={{ position: 'fixed', inset: 0, zIndex: 50, }}>
{user.name || 'Mi cuenta'}
{user.email}
Mi cuenta Mi examen 1
)}
)}
setAuthOpen(false)} initialMode={authMode} /> ); }; const WHATSAPP_NUMBER = '34604935221'; // E.164 for wa.me link const WHATSAPP_DISPLAY = '604 93 52 21'; const CONTACT_EMAIL = 'contacto@bristolprivatelessons.es'; const SiteFooter = () => { return ( ); }; // Floating WhatsApp button const WhatsAppFloat = () => ( e.currentTarget.style.transform = 'scale(1.08)'} onMouseLeave={(e) => e.currentTarget.style.transform = 'scale(1)'}> ); window.SiteHeader = SiteHeader; window.SiteFooter = SiteFooter; window.WhatsAppFloat = WhatsAppFloat; window.WHATSAPP_NUMBER = WHATSAPP_NUMBER; window.WHATSAPP_DISPLAY = WHATSAPP_DISPLAY; window.CONTACT_EMAIL = CONTACT_EMAIL;