NGU-Web/src/components/PrivacyNotice.tsx
Zaldimmar de17da7dc8 Accessibility: reader view and full palette swaps; version v1.12.1-accessibility
- Reading mode is now a reader view (ReaderView.tsx): the page renders
  hidden and its headings, paragraphs, links and described pictures
  are written out in one column, with no header, backdrop or footer.
- Color blind modes swap all three color families (teal, green,
  amber); palette hexes in components and CSS are now
  var(--pal-<family>-<shade>) so the modes reach them.
- CLAUDE.md and docs/updating-data-in-code.md describe both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 16:10:57 -05:00

64 lines
2.3 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. Analytics are Plausible,
self-hosted and cookieless, which needs no consent either. If an
embed ever loads on its own, or anything sets a tracking cookie,
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 = 'site-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-20 left-4 right-4 z-40 sm:bottom-4 mx-auto max-w-md 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 btn bg-action px-4 py-1.5 text-white hover:bg-action-hover"
>
Got it
</button>
</div>
)
}