/* global React, ReactDOM, NA_DATA, NASite, HomePage, TeamsPage, FixturesPage, SessionsPage, CampsPage, AcademyPage, TravelTeamsPage, CoachesPage, AboutPage, SponsorsPage, ShopPage, ContactPage, JoinSuccessPage, useTweaks, TweaksPanel, TweakSection, TweakRadio, TweakSelect */ const { useState, useEffect } = React; const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "accent": "yellow", "density": "comfortable", "heroVariant": "scoreboard" }/*EDITMODE-END*/; function App() { // If the user has been redirected back from GoCardless (or hit /join-success // directly), land them on the success screen on first render. const initialPage = (() => { if (typeof window === 'undefined') return 'home'; if (window.location.hash === '#join-success') return 'join-success'; if (window.location.pathname.endsWith('/join-success')) return 'join-success'; return 'home'; })(); const [page, setPage] = useState(initialPage); const [mobileOpen, setMobileOpen] = useState(false); const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); useEffect(() => { document.documentElement.setAttribute('data-accent', tweaks.accent); document.documentElement.setAttribute('data-density', tweaks.density); }, [tweaks.accent, tweaks.density]); useEffect(() => { window.scrollTo({ top: 0, behavior: 'instant' }); }, [page]); const { Topbar, Footer } = NASite; const renderPage = () => { switch (page) { case 'home': return ; case 'teams': return ; case 'fixtures': return ; case 'sessions': return ; case 'camps': return ; case 'academy': return ; case 'travel': return ; case 'coaches': return ; case 'about': return ; case 'sponsors': return ; case 'shop': return ; case 'contact': return ; case 'join-success': return ; default: return ; } }; return (
{renderPage()}
setTweak('accent', v)} options={[ { value: 'yellow', label: 'Yellow' }, { value: 'blue', label: 'Royal blue' }, { value: 'cherry', label: 'Cherry red' }, ]} /> setTweak('density', v)} options={[ { value: 'comfortable', label: 'Comfortable' }, { value: 'compact', label: 'Compact' }, ]} /> setTweak('heroVariant', v)} options={[ { value: 'scoreboard', label: 'Scoreboard — next fixture' }, { value: 'photo', label: 'Photo lead — single action shot' }, { value: 'stats', label: 'Stats grid — at-a-glance' }, ]} />
); } const __rootEl = document.getElementById('root'); // Remove the boot splash so React renders into a clean container. __rootEl.innerHTML = ''; ReactDOM.createRoot(__rootEl).render();