NGU-Web/src/components/PrivacyNotice.tsx
Zaldimmar c74ad746f5 Add colour tokens, dark mode and drop gradients
- Colour tokens in index.css named by role (ink, body, muted, link,
  brand, action, surface, tint, danger), used everywhere instead of hex
- Dark mode: follows the system, a header toggle (site and admin)
  overrides it and is remembered; set before first paint in index.html
- Data colours go through src/lib/color.ts: withAlpha for tints,
  accentText (lighter on dark) for text in an accent, readableOn for
  text on one, so an admin's pale colour still reads
- Migration 040 drops events.gradient: a card is its photo or plain,
  with its colour as the border; other decorative gradients are solid
- The countdown and a hero event without a photo mix their colour
  toward ink behind white text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:42:59 -05:00

63 lines
2.2 KiB
TypeScript

/* ═══════════════════════════════════════════════════════════════
PRIVACY NOTICE
A small note on a first visit, until closed: the site sets no
tracking cookies, and videos and maps from other companies wait
for a click (VideoPlayer, HeroStage, ScheduleBlock). Because
nothing loads before that, a notice is enough, rather than a
consent banner that blocks the page. If an embed ever loads on
its own, or analytics are added, this has to become a real
consent choice.
Closed is remembered in this browser; blocked storage just
means it shows again next time.
═══════════════════════════════════════════════════════════════ */
import { useEffect, useState } from 'react'
import { Link } from 'react-router-dom'
const STORAGE_KEY = 'ngu-privacy-notice-closed'
export default function PrivacyNotice() {
const [visible, setVisible] = useState(false)
useEffect(() => {
try {
if (!localStorage.getItem(STORAGE_KEY)) setVisible(true)
} catch {
setVisible(true)
}
}, [])
const close = () => {
setVisible(false)
try {
localStorage.setItem(STORAGE_KEY, '1')
} catch {}
}
if (!visible) return null
return (
<div
role="region"
aria-label="Privacy notice"
className="fixed bottom-4 left-4 right-4 z-40 mx-auto max-w-md rounded-2xl border border-brand/20 bg-surface p-4 text-sm text-body shadow-xl sm:right-auto"
>
<p>
No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press
play or show them, and those services may set their own cookies then.{' '}
<Link to="/privacy#cookies" className="font-semibold text-link underline underline-offset-2">
Privacy Policy
</Link>
</p>
<button
type="button"
onClick={close}
className="mt-3 rounded-full bg-action px-4 py-1.5 font-semibold text-white hover:bg-action-hover"
>
Got it
</button>
</div>
)
}