From 916dde01947c94968c68b5f320264313666b53b4 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 19 Oct 2025 21:06:35 +0000 Subject: [PATCH] Add banner state/fetch before loading check cgen-96248927e0f943f3b7ae10528295dcd6 --- client/pages/Index.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/pages/Index.tsx b/client/pages/Index.tsx index 1f434e57..5d00e5ef 100644 --- a/client/pages/Index.tsx +++ b/client/pages/Index.tsx @@ -242,6 +242,17 @@ export default function Index() { }, ]; + const [homeBanner, setHomeBanner] = useState<{ text: string; enabled?: boolean; style?: string } | null>(null); + + useEffect(() => { + fetch("/api/site-settings?key=home_banner") + .then((r) => (r.ok ? r.json() : null)) + .then((v) => { + if (v && typeof v === "object") setHomeBanner(v as any); + }) + .catch(() => void 0); + }, []); + if (isLoading) { return (