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

@ -1,30 +1,191 @@
import { Link } from "react-router-dom";
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import { DATA_REQUEST } from "../data/feedbackTypes.ts";
import { PRIVACY_EMAIL, sitePage } from "../lib/site.ts";
import FeedbackForm from "./sections/FeedbackForm.tsx";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/privacy");
/* ═══════════════════════════════════════════════════════════════
Privacy policy, cookie notice included.
What it says must stay true of the code: what the feedback form
stores (routes/feedback.js), what the browser keeps (Banner,
PrivacyNotice, the theme toggle), which embeds wait for a click
(VideoPlayer, HeroStage, ScheduleBlock), and that nothing about
a minor is shown. Change the date when the wording changes.
The contact address is Panel → Site settings → Privacy contact
email. Requests from the form below are feedback rows of type
'privacy', in Admin → Feedback.
═══════════════════════════════════════════════════════════════ */
const LAST_UPDATED = "September 28, 2026";
const ACCENT = "#0f7183";
const link = "underline underline-offset-2 text-[#0f7183]";
const contact = PRIVACY_EMAIL ? (
<>
email <a className={link} href={`mailto:${PRIVACY_EMAIL}`}>{PRIVACY_EMAIL}</a> or use the{" "}
<a className={link} href="#requests">request form</a> below
</>
) : (
<>
use the <a className={link} href="#requests">request form</a> below
</>
);
const PARTS: LegalPart[] = [
{
id: "summary",
heading: "In short",
body: [
"We collect some information about the people who use this site and take part in Next Generation of Unity (NGU). We use it to run our programs and this website, we don't sell it, and we don't use advertising or tracking cookies.",
<>If you want to see, correct or delete what we hold about you, {contact}.</>,
],
},
{
id: "what-we-collect",
heading: "What we collect",
body: ["Depending on how you use the site and our programs:"],
list: [
<>
<strong>Feedback and requests you send.</strong> Your message, the page it's about, and, if you
give them, your name and email. With it we keep your browser's description (its user agent) and
a scrambled form of your IP address that can't be turned back into the address; we use it only to
spot abuse.
</>,
<>
<strong>People on the site.</strong> Leaders, speakers and volunteers can appear with a name,
photo, role, short bio and public contact details. Staff may also keep private details, such as a
birth date, private email, phone number or address, which are never shown on the site and can
only be seen by our editors.
</>,
<>
<strong>Server records.</strong> Like most websites, our server keeps short-lived logs of
requests (the page asked for, the time, and the IP address that asked) to keep the site running
and secure.
</>,
<>
<strong>Staff accounts.</strong> For NGU staff and volunteers who sign in to edit the site: name,
email, role, and a record of sign-ins. Passwords are stored only in a form that can't be read back.
</>,
],
},
{
id: "minors",
heading: "Young people",
body: [
"We don't show information about anyone under 18 on this site: no names, photos or details. If you believe something about a minor appears here, tell us and we'll take it down.",
],
},
{
id: "how-we-use",
heading: "How we use it",
body: [
"To answer you, to run our retreats, chapters and other programs, to keep this site accurate and working, and to keep it secure. We don't sell or rent your information, and we don't use it for advertising.",
],
},
{
id: "ai",
heading: "Artificial intelligence",
body: [
"We used AI tools to help write this website's code and build its structure. Those tools have no access to our database. Information you give us, and information we hold about the people in our community, is not given to AI systems, and isn't used to train them.",
],
},
{
id: "third-parties",
heading: "Other services",
body: [
"We try not to rely on other companies, but a few parts of the site are provided by them. When you use those parts, what you enter or do there goes to that company and is covered by its own privacy policy:",
],
list: [
<>
<strong>Giving</strong> is handled by Church Center (Planning Center). Payment details go to them,
not to us.
</>,
<>
<strong>Videos</strong> come from YouTube, Facebook or Vimeo, and <strong>maps</strong> from Google
Maps. Nothing from them loads until you press play or choose to show the map.
</>,
<>
<strong>Links</strong> to social media, Substack and other sites take you to those sites, which
follow their own rules.
</>,
<>
<strong>Staff sign-in</strong> can use a Google account on our own domain.
</>,
],
after: [
"This site runs on a server we rent and manage ourselves; your information is stored there, not with an outside website service.",
],
},
{
id: "cookies",
heading: "Cookies and browser storage",
body: [
"This site doesn't use advertising, analytics or tracking cookies. It keeps a few small things in your own browser so it works the way you left it:",
],
list: [
"That you closed the announcement banner or the privacy notice.",
"Whether you chose the light or dark look.",
"For staff who sign in: a sign-in cookie that keeps you signed in, and a short-lived one used while signing in with Google.",
],
after: [
"None of these are shared with anyone. If you press play on a video or show a map, that service (YouTube, Facebook, Vimeo or Google) may set its own cookies from then on. You can clear all of this in your browser's settings at any time.",
],
},
{
id: "your-rights",
heading: "Your choices",
body: [
<>
You can ask to see the information we hold about you, to correct it, or to have it deleted. To do
that, {contact}. We may ask you to confirm it's you before we change or delete anything, and we'll
tell you when it's done. Some records we may need to keep, such as records of gifts that the law
requires; if so, we'll say which and why.
</>,
],
},
{
id: "changes",
heading: "Changes to this policy",
body: [
<>
If we change how we handle information, we'll update this page and the date at the top. See also
our <Link className={link} to="/terms">Terms of Service</Link>.
</>,
],
},
];
const SECTIONS = [
{
id: "privacy",
title: "Privacy Policy",
blurb: "Last updated: [date]",
accent: "#0f7183",
blurb: `Last updated: ${LAST_UPDATED}`,
accent: ACCENT,
background: "#ffffff",
content: <LegalText parts={PARTS} />,
},
{
id: "requests",
title: "Data requests",
blurb: "Ask to see, correct or delete the information we hold about you.",
accent: ACCENT,
background: "#eef9fb",
content: (
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">
{/* Policy text goes here */}
<div className="mx-auto max-w-3xl px-6">
<FeedbackForm fixedType={DATA_REQUEST.id} />
</div>
),
},
];
export default function PrivacyPage() {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);
return <PageShell title={PAGE.title} intro={PAGE.description} sections={SECTIONS} />;
}

View file

@ -1,30 +1,93 @@
import { Link } from "react-router-dom";
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/terms");
/* Change the date when the wording changes. */
const LAST_UPDATED = "September 28, 2026";
const link = "underline underline-offset-2 text-[#0f7183]";
const PARTS: LegalPart[] = [
{
id: "using-the-site",
heading: "Using this site",
body: [
"This website belongs to Next Generation of Unity (NGU). By using it you agree to these terms. If you don't agree, please don't use the site.",
"You're welcome to read, share and link to anything here. Please don't try to break or overload the site, get into parts of it you haven't been given access to, or use it to break the law.",
],
},
{
id: "our-content",
heading: "Our content",
body: [
"The words, logos, photos and videos on this site belong to NGU or to the people who made them, and are used with permission. You can share them for personal and non-commercial use with credit to NGU. For anything else, including using our name or logo, ask us first.",
],
},
{
id: "what-you-send",
heading: "What you send us",
body: [
"When you send feedback or a request, you let us use it to answer you and to improve the site and our programs. Please don't send anything unlawful, abusive, or someone else's private information.",
],
},
{
id: "programs-and-giving",
heading: "Programs, events and giving",
body: [
"Dates, places and details of retreats and other events can change. The event's organizers have the final word, and registering for an event may come with its own terms.",
"Gifts are made through Church Center (Planning Center), under its terms. Questions about a gift can come to us.",
],
},
{
id: "other-sites",
heading: "Other sites",
body: [
"We link to and show videos, maps and posts from other sites. We don't control them and aren't responsible for what they say or do; their own terms and privacy policies apply.",
],
},
{
id: "staff-accounts",
heading: "Staff accounts",
body: [
"Accounts for editing the site are for NGU staff and volunteers we've set up. Keep your password and sign-in to yourself. We can change or close an account at any time.",
],
},
{
id: "no-guarantees",
heading: "No guarantees",
body: [
"We work to keep this site accurate and running, but it's provided as it is, without guarantees that it will always be available, complete or free of mistakes. To the extent the law allows, NGU isn't liable for losses that come from using it.",
],
},
{
id: "changes",
heading: "Changes",
body: [
<>
We may update these terms; the date at the top says when they last changed. How we handle personal
information is in our <Link className={link} to="/privacy">Privacy Policy</Link>, and you can reach
us through the <Link className={link} to="/feedback">feedback form</Link>.
</>,
],
},
];
const SECTIONS = [
{
id: "terms",
title: "Terms of Service",
blurb: "Last updated: [date]",
blurb: `Last updated: ${LAST_UPDATED}`,
accent: "#0f7183",
background: "#eef9fb",
content: (
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">
{/* Terms text goes here */}
</div>
),
background: "#ffffff",
content: <LegalText parts={PARTS} />,
},
];
export default function TermsPage() {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);
return <PageShell title={PAGE.title} intro={PAGE.description} sections={SECTIONS} />;
}

View file

@ -9,12 +9,16 @@
The page and section options come from navConfig, so adding a
page to the nav adds it to this form too.
With fixedType the type is set and neither picker shows. The
Privacy page uses it for data requests (DATA_REQUEST), which also
need an email, since the answer has to go somewhere.
═══════════════════════════════════════════════════════════════ */
import { useState } from "react";
import { post, ApiError } from "../../lib/api.ts";
import { PAGE_LINKS, PAGE_SECTIONS } from "../../navConfig.ts";
import { FEEDBACK_TYPES } from "../../data/feedbackTypes.ts";
import { DATA_REQUEST, FEEDBACK_TYPES } from "../../data/feedbackTypes.ts";
const ACCENT = "#0f7183";
const MUTED = "#4a6b72";
@ -216,8 +220,9 @@ function describeLocation(page, section) {
/* ── The form ────────────────────────────────────────────────── */
export default function FeedbackForm() {
const [type, setType] = useState<any>(null);
export default function FeedbackForm({ fixedType }: { fixedType?: string } = {}) {
const request = fixedType === DATA_REQUEST.id;
const [type, setType] = useState<any>(fixedType ?? null);
const [page, setPage] = useState(SITE_WIDE);
const [section, setSection] = useState(WHOLE_PAGE);
const [message, setMessage] = useState("");
@ -233,7 +238,8 @@ export default function FeedbackForm() {
const [fieldErrors, setFieldErrors] = useState<any>({});
const sending = status === "sending";
const ready = Boolean(type) && message.trim().length >= MIN_MESSAGE;
const ready =
Boolean(type) && message.trim().length >= MIN_MESSAGE && (!request || email.trim() !== "");
async function handleSubmit(event) {
event.preventDefault();
@ -271,7 +277,7 @@ export default function FeedbackForm() {
}
function reset() {
setType(null);
setType(fixedType ?? null);
setPage(SITE_WIDE);
setSection(WHOLE_PAGE);
setMessage("");
@ -299,16 +305,18 @@ export default function FeedbackForm() {
</p>
)}
<p className="mt-3 max-w-prose" style={{ color: MUTED }}>
{email
? `We'll follow up at ${email} if we have questions.`
: "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
{request
? `We'll reply to ${email}. We may ask you to confirm it's you before we change or delete anything.`
: email
? `We'll follow up at ${email} if we have questions.`
: "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
</p>
<button
type="button"
onClick={reset}
className="mt-6 rounded-full border border-[#138ba0] px-5 py-2.5 font-semibold text-[#0f7183] transition-colors hover:bg-[#eef9fb] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40"
>
Send more feedback
{request ? "Send another request" : "Send more feedback"}
</button>
</div>
);
@ -320,28 +328,33 @@ export default function FeedbackForm() {
noValidate
className="rounded-2xl border border-[#138ba0]/20 bg-white p-6 sm:p-8"
>
<TypePicker value={type} onChange={setType} />
{!fixedType && (
<>
<TypePicker value={type} onChange={setType} />
<div className="mt-10">
<LocationPicker
page={page}
section={section}
onPageChange={setPage}
onSectionChange={setSection}
/>
</div>
<div className="mt-10">
<LocationPicker
page={page}
section={section}
onPageChange={setPage}
onSectionChange={setSection}
/>
</div>
</>
)}
{/* Message */}
<div className="mt-10">
<div className={fixedType ? "" : "mt-10"}>
<label
htmlFor="feedback-message"
className="text-base font-semibold text-[#26454c]"
>
Tell us more
{request ? "Your request" : "Tell us more"}
</label>
<p className="mt-1 text-sm" style={{ color: MUTED }}>
What you expected to happen, and what happened instead, is the most
useful thing you can give us.
{request
? "Say what you'd like: to see the information we hold about you, to correct it, or to have it deleted. Tell us how you've been in touch with NGU (a retreat, a chapter, this site) so we can find it."
: "What you expected to happen, and what happened instead, is the most useful thing you can give us."}
</p>
<textarea
id="feedback-message"
@ -349,7 +362,11 @@ export default function FeedbackForm() {
maxLength={MAX_CHARS}
value={message}
onChange={(e) => setMessage(e.target.value)}
placeholder="I was looking for the summer retreat dates and…"
placeholder={
request
? "Please delete the details I gave when I registered for…"
: "I was looking for the summer retreat dates and…"
}
aria-invalid={Boolean(fieldErrors.message)}
aria-describedby={fieldErrors.message ? "feedback-message-error" : undefined}
className={`mt-4 resize-y ${fieldClass} ${
@ -370,12 +387,15 @@ export default function FeedbackForm() {
{/* Optional contact details */}
<div className="mt-8 rounded-xl border border-dashed border-[#4a6b72]/30 bg-[#eef9fb]/60 p-5 sm:p-6">
<div className="flex flex-wrap items-center">
<h3 className="text-base font-semibold text-[#26454c]">Your details</h3>
<OptionalTag />
<h3 className="text-base font-semibold text-[#26454c]">
{request ? "How we reach you" : "Your details"}
</h3>
{!request && <OptionalTag />}
</div>
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
Leave these blank and your feedback comes through anonymously. Fill
them in only if you'd like a reply, we won't add you to any list.
{request
? "We use these only to answer this request, and we won't add you to any list."
: "Leave these blank and your feedback comes through anonymously. Fill them in only if you'd like a reply, we won't add you to any list."}
</p>
<div className="mt-5 grid gap-4 sm:grid-cols-2">
@ -400,12 +420,14 @@ export default function FeedbackForm() {
htmlFor="feedback-email"
className="block text-sm font-medium text-[#26454c]"
>
Email <span className="font-normal text-[#4a6b72]">(optional)</span>
Email{" "}
<span className="font-normal text-[#4a6b72]">{request ? "(required)" : "(optional)"}</span>
</label>
<input
id="feedback-email"
type="email"
autoComplete="email"
required={request}
value={email}
onChange={(e) => setEmail(e.target.value)}
aria-invalid={Boolean(fieldErrors.email)}
@ -449,11 +471,13 @@ export default function FeedbackForm() {
disabled={!ready || sending}
className="rounded-full bg-[#0f7183] px-7 py-3 font-semibold text-white transition-colors hover:bg-[#0b5c6a] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40 disabled:cursor-not-allowed disabled:bg-[#4a6b72]/25 disabled:text-white/80"
>
{sending ? "Sending…" : "Send feedback"}
{sending ? "Sending…" : request ? "Send request" : "Send feedback"}
</button>
{!ready && !sending && (
<p className="text-sm" style={{ color: MUTED }}>
Choose a type and write at least a sentence to send.
{request
? "Write at least a sentence and give an email address to send."
: "Choose a type and write at least a sentence to send."}
</p>
)}
</div>

View file

@ -40,6 +40,7 @@ import { useEffect, useState, type CSSProperties } from 'react'
import { Link } from 'react-router-dom'
import HomeLink from './HomeLink.tsx'
import VideoPlayer from '../../../components/VideoPlayer.tsx'
import DoveMark from '../../../components/DoveMark.tsx'
import PlatformIcon from '../../../components/PlatformIcon.tsx'
import { livestreamEmbedUrl, videoSource, type VideoSource } from '../../../lib/embeds.ts'
@ -352,14 +353,17 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
/* ── Livestream ──────────────────────────────────────────────── */
/* The player loads when pressed, not with the page, so YouTube or
Facebook set nothing until someone asks to watch (Privacy page). */
function LiveFrame({ src, url, title }: { src: string | null; url: string; title?: string | null }) {
const [watching, setWatching] = useState(false)
return (
<div
className="relative overflow-hidden rounded-3xl border border-white/15 bg-black shadow-2xl"
style={{ boxShadow: '0 30px 80px -20px rgba(16, 212, 138, 0.35)' }}
>
<div className="aspect-video w-full">
{src ? (
{src && watching ? (
<iframe
src={src}
title={title || 'Livestream'}
@ -367,6 +371,17 @@ function LiveFrame({ src, url, title }: { src: string | null; url: string; title
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
allowFullScreen
/>
) : src ? (
<div className="flex h-full w-full flex-col items-center justify-center gap-4 text-white">
<span className="hp-live-dot h-4 w-4 rounded-full bg-[#ff4d4d]" aria-hidden="true" />
<button
type="button"
onClick={() => setWatching(true)}
className="rounded-full bg-white px-6 py-3 font-semibold text-[#04262e] hover:scale-105"
>
Watch live
</button>
</div>
) : (
<div className="flex h-full w-full flex-col items-center justify-center gap-4 text-white">
<span className="hp-live-dot h-4 w-4 rounded-full bg-[#ff4d4d]" aria-hidden="true" />
@ -387,8 +402,9 @@ function LiveFrame({ src, url, title }: { src: string | null; url: string; title
/* A file plays in <video> with the browser's controls; preload
"metadata" fetches enough for the first frame and the length,
not the whole file. An embed waits for play. A link that is
neither still gets a button out to it. */
not the whole file. An embed is a VideoPlayer: a still until
pressed, so the video's host sets nothing before then. A link
that is neither still gets a button out to it. */
function VideoFrame({
source,
url,
@ -414,13 +430,7 @@ function VideoFrame({
preload="metadata"
/>
) : source?.kind === 'embed' ? (
<iframe
src={source.src}
title={title || 'Featured video'}
className="h-full w-full"
allow="encrypted-media; picture-in-picture; fullscreen"
allowFullScreen
/>
<VideoPlayer url={url} title={title || 'Featured video'} className="h-full" />
) : (
<div className="flex h-full w-full items-center justify-center">
<HomeLink