Production ready
This commit is contained in:
@@ -10,20 +10,20 @@ export function CookieBanner() {
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
const optedIn = posthog.has_opted_in_capturing()
|
||||
const optedOut = posthog.has_opted_out_capturing()
|
||||
|
||||
if (!optedIn && !optedOut) {
|
||||
const cookieConsent = localStorage.getItem('cookie_consent')
|
||||
if (!cookieConsent) {
|
||||
setShow(true)
|
||||
}
|
||||
}, [])
|
||||
|
||||
const handleAccept = () => {
|
||||
localStorage.setItem('cookie_consent', 'accepted')
|
||||
posthog.opt_in_capturing()
|
||||
setShow(false)
|
||||
}
|
||||
|
||||
const handleDecline = () => {
|
||||
localStorage.setItem('cookie_consent', 'declined')
|
||||
posthog.opt_out_capturing()
|
||||
setShow(false)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ export function CookieBanner() {
|
||||
<div className="flex-1">
|
||||
<h3 className="text-lg font-semibold text-foreground mb-2">We value your privacy</h3>
|
||||
<p className="text-sm text-muted-foreground mb-4 leading-relaxed">
|
||||
We use cookies to enhance your browsing experience and analyze our traffic. By clicking "Accept", you consent to our use of cookies.
|
||||
We use cookies to enhance your browsing experience and analyze our traffic. By clicking "Accept", you consent to our use of cookies.
|
||||
Read our <Link href="/privacy" className="underline hover:text-foreground">Privacy Policy</Link>.
|
||||
</p>
|
||||
<div className="flex flex-col gap-2 sm:flex-row">
|
||||
|
||||
Reference in New Issue
Block a user