diff --git a/attached_assets/image_1772624103161.png b/attached_assets/image_1772624103161.png new file mode 100644 index 0000000..5b8a378 Binary files /dev/null and b/attached_assets/image_1772624103161.png differ diff --git a/client/src/App.tsx b/client/src/App.tsx index aee45d0..b080da1 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -12,6 +12,7 @@ import GalleryPageWrapper from "@/pages/gallery"; import HoroscopePage from "@/pages/horoscope"; import RecipesPage from "@/pages/recipes"; import SearchPage from "@/pages/search"; +import CookieConsent from "@/components/cookie-consent"; function Router() { return ( diff --git a/client/src/components/cookie-consent.tsx b/client/src/components/cookie-consent.tsx new file mode 100644 index 0000000..4204b39 --- /dev/null +++ b/client/src/components/cookie-consent.tsx @@ -0,0 +1,54 @@ +import { useState, useEffect } from "react"; +import { X } from "lucide-react"; + +const CONSENT_KEY = "folx_cookie_consent"; + +export default function CookieConsent() { + const [visible, setVisible] = useState(false); + + useEffect(() => { + const consent = localStorage.getItem(CONSENT_KEY); + if (!consent) { + const timer = setTimeout(() => setVisible(true), 1500); + return () => clearTimeout(timer); + } + }, []); + + const accept = () => { + localStorage.setItem(CONSENT_KEY, "accepted"); + setVisible(false); + }; + + if (!visible) return null; + + return ( +