Add the Privacy and Terms pages, data requests and click-to-load embeds

- Privacy Policy (with cookies and storage) and Terms of Service, from
  what the code actually stores and loads; shared LegalText layout
- Data requests: a 'privacy' feedback type sent from the Privacy page's
  form, email required, triaged in Admin -> Feedback
- Migration 039: Panel -> Site settings -> Privacy contact email (over
  site.json's privacyEmail), shown on the Privacy page
- The hero livestream, the hero featured video and schedule maps load
  only when pressed, so no third party sets anything before a click
- A small dismissible privacy notice instead of a consent banner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:34:46 -05:00
parent bff082652a
commit ee61568911
17 changed files with 507 additions and 81 deletions

View file

@ -4,6 +4,7 @@ import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
import Banner from "./Banner.tsx";
import nguLogo from "../assets/logos/NGU_Logo.svg";
import Footer from "./Footer.tsx";
import PrivacyNotice from "./PrivacyNotice.tsx";
/* ── Right-side nav actions ──────────────────────────────── */
@ -269,6 +270,7 @@ export default function Layout() {
{/*Site Footer applied to every page*/}
<div inert={mobileMenuOpen}>
<Footer />
<PrivacyNotice />
</div>
{/* Mobile menu */}

View file

@ -0,0 +1,46 @@
/* ═══════════════════════════════════════════════════════════════
LEGAL TEXT
The Privacy and Terms pages: a list of headed parts, each a few
paragraphs or a bullet list, in a readable column. The words live
in the page files; this only lays them out the same way.
═══════════════════════════════════════════════════════════════ */
import type { ReactNode } from 'react'
export type LegalPart = {
/** Anchor for linking to one part, eg. 'cookies'. */
id: string
heading: string
body: ReactNode[]
list?: ReactNode[]
/** After the list. */
after?: ReactNode[]
}
export default function LegalText({ parts }: { parts: LegalPart[] }) {
return (
<div className="mx-auto max-w-3xl space-y-10 px-6 leading-relaxed text-[#2c4a50]">
{parts.map((part) => (
<section key={part.id} id={part.id} style={{ scrollMarginTop: '6rem' }}>
<h3 className="text-xl font-bold text-[#073d4a]">{part.heading}</h3>
<div className="mt-3 space-y-3">
{part.body.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
{part.list && (
<ul className="list-disc space-y-2 pl-6">
{part.list.map((item, i) => (
<li key={i}>{item}</li>
))}
</ul>
)}
{part.after?.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
</div>
</section>
))}
</div>
)
}

View file

@ -0,0 +1,63 @@
/* ═══════════════════════════════════════════════════════════════
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-[#138ba0]/20 bg-white p-4 text-sm text-[#26454c] 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-[#0f7183] underline underline-offset-2">
Privacy Policy
</Link>
</p>
<button
type="button"
onClick={close}
className="mt-3 rounded-full bg-[#0f7183] px-4 py-1.5 font-semibold text-white hover:bg-[#0b5c6a]"
>
Got it
</button>
</div>
)
}

View file

@ -80,6 +80,8 @@ function Avatar({ person, size }: { person: NonNullable<ContentBlockItem['person
function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
const [open, setOpen] = useState(false)
// Google's map loads only when asked for (Privacy page).
const [showMap, setShowMap] = useState(false)
const panelId = useId()
const graphic = blockMedia(entry.media)
const place = entry.map?.trim()
@ -169,13 +171,25 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
{place && (
<div>
<iframe
src={mapEmbed(place)}
title={`Map: ${place}`}
loading="lazy"
referrerPolicy="no-referrer-when-downgrade"
className="aspect-video w-full rounded-lg border-0"
/>
{showMap ? (
<iframe
src={mapEmbed(place)}
title={`Map: ${place}`}
loading="lazy"
referrerPolicy="no-referrer-when-downgrade"
className="aspect-video w-full rounded-lg border-0"
/>
) : (
<button
type="button"
onClick={() => setShowMap(true)}
className="flex aspect-video w-full flex-col items-center justify-center gap-1 rounded-lg border border-dashed text-sm"
style={{ borderColor: `${accent}55`, color: BODY }}
>
<span className="font-semibold">Show map</span>
<span className="text-xs">{place}, from Google Maps</span>
</button>
)}
<a
href={mapLink(place)}
target="_blank"