// Tweaks panel for stageformedics.com const { useEffect } = React; function App() { const [t, setTweak] = useTweaks(window.TWEAK_DEFAULTS || { palette: 'midnight', heroStyle: 'editorial', showOrnament: true, }); // mirror to body data-attrs useEffect(() => { document.body.dataset.palette = t.palette; document.body.dataset.hero = t.heroStyle; document.body.dataset.showOrnament = String(t.showOrnament !== false); }, [t.palette, t.heroStyle, t.showOrnament]); return ( setTweak('heroStyle', v)} /> setTweak('showOrnament', v)} /> setTweak('palette', v)} /> ); } // pass defaults through to React (the host parses the JSON between EDITMODE markers) window.TWEAK_DEFAULTS = TWEAK_DEFAULTS; const root = document.createElement('div'); document.body.appendChild(root); ReactDOM.createRoot(root).render();