// Main app — routing + shell function App() { // route can be: "home", "services", "service:", "upload", "gallery", "why", "about", "careers", "contact" const initialRoute = window.__BYTESGLUE_SHOWCASE_ROUTE || "home"; const [route, setRoute] = React.useState(initialRoute); const [routeArg, setRouteArg] = React.useState(null); // Sync to hash for direct linking React.useEffect(() => { const apply = () => { const h = (window.location.hash || ("#" + initialRoute)).slice(1); setRoute(h || "home"); }; apply(); window.addEventListener("hashchange", apply); return () => window.removeEventListener("hashchange", apply); }, []); const navigate = (next, arg = null) => { setRoute(next); setRouteArg(arg); window.location.hash = "#" + next; window.scrollTo({ top: 0, behavior: "instant" }); }; let page; if (route === "home") page = ; else if (route === "services") page = ; else if (route.startsWith("service:")) page = ; else if (route === "upload") page = ; else if (route === "gallery") page = ; else if (route === "why") page = ; else if (route === "about") page = ; else if (route === "careers") page = ; else if (route === "contact") page = ; else page = ; return (
{page}