// Maison Yeya — App shell
function App() {
const [route, setRoute] = useState("home");
const [savedLooks, setSavedLooks] = useState([]);
const [openLook, setOpenLook] = useState(null);
const [enquiryOpen, setEnquiryOpen] = useState(false);
const [apptOpen, setApptOpen] = useState(false);
const [t, setTweak] = useTweaks(window.TWEAK_DEFAULTS);
// Apply tweaks → CSS variables
useEffect(() => {
const root = document.documentElement;
const accent = ACCENTS[t.accent] || ACCENTS.champagne;
root.style.setProperty("--accent", accent.value);
root.style.setProperty("--accent-deep", accent.deep);
root.style.setProperty("--serif-display", `"${t.displayFont}", "Cormorant Garamond", serif`);
}, [t.accent, t.displayFont]);
// Hide initial-load splash
useEffect(() => {
const el = document.getElementById("initial-load");
if (el) {
setTimeout(() => {
el.classList.add("gone");
setTimeout(() => el.remove(), 700);
}, 220);
}
}, []);
// Scroll to top on route change
useEffect(() => {
window.scrollTo({ top: 0, behavior: "smooth" });
}, [route]);
const isSaved = useCallback((look) => savedLooks.some(s => s.id === look.id), [savedLooks]);
const onSave = useCallback((look) => {
setSavedLooks(prev => {
if (prev.some(p => p.id === look.id)) return prev.filter(p => p.id !== look.id);
return [...prev, look];
});
}, []);
const onRemoveSaved = useCallback((look) => {
setSavedLooks(prev => prev.filter(p => p.id !== look.id));
}, []);
const onAppointment = () => { setApptOpen(true); setEnquiryOpen(false); };
const onEnquiry = () => setEnquiryOpen(true);
const onOpenLook = (l) => setOpenLook(l);
return (
{route === "home" && (
)}
{route === "bridal" && (
)}
{route === "couture" && (
)}
{route === "atelier" && (
)}
{route === "press" && (
)}
{route === "contact" && (
)}
{/* Overlays */}
setOpenLook(null)}
onSave={onSave}
saved={openLook ? isSaved(openLook) : false}
onAppointment={() => { setOpenLook(null); onAppointment(); }}/>
setEnquiryOpen(false)}
onRemove={onRemoveSaved}
onAppointment={() => { setEnquiryOpen(false); onAppointment(); }}/>
setApptOpen(false)}
savedItems={savedLooks}
onRemoveSaved={onRemoveSaved}/>
{/* Tweaks Panel */}
setTweak("displayFont", v)}
options={[
{ value: "Italiana", label: "Italiana" },
{ value: "Tenor Sans", label: "Tenor" },
{ value: "Cormorant Garamond", label: "Cormorant" }
]}/>
setTweak("accent", v)}
options={[
{ value: "champagne", label: "Champagne" },
{ value: "blush", label: "Blush" },
{ value: "ink", label: "Ink" },
{ value: "rouge", label: "Rouge" }
]}/>
setTweak("showVerticals", v)}/>
setTweak("homeHero", v)}
options={[
{ value: "marionettes", label: "Les Marionettes" },
{ value: "bridal", label: "Shades of White" },
{ value: "valenciennes", label: "Les Valenciennes" },
{ value: "runway", label: "L'Ascension" }
]}/>
);
}
// Mount
ReactDOM.createRoot(document.getElementById("root")).render();