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:
parent
bff082652a
commit
ee61568911
17 changed files with 507 additions and 81 deletions
|
|
@ -33,7 +33,7 @@ what a dropdown in the admin editor says.
|
||||||
| The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) |
|
| The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) |
|
||||||
| The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) |
|
| The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) |
|
||||||
| Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) |
|
| Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) |
|
||||||
| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` |
|
| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing, privacy contact email | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` |
|
||||||
| Uploaded images | disk + the `media` table | Admin → Tools → Media, or any image field. See `docs/media-uploads.md` |
|
| Uploaded images | disk + the `media` table | Admin → Tools → Media, or any image field. See `docs/media-uploads.md` |
|
||||||
|
|
||||||
The rule of thumb from `CLAUDE.md`: data belongs in the database,
|
The rule of thumb from `CLAUDE.md`: data belongs in the database,
|
||||||
|
|
@ -273,7 +273,8 @@ The numbers band's "Number Source" dropdown works the same way:
|
||||||
| Site-wide announcement banner | `src/data/bannerConfig.ts` | `enabled: false` hides it. Bump `id` when the message changes, so people who dismissed the old one see the new one. |
|
| Site-wide announcement banner | `src/data/bannerConfig.ts` | `enabled: false` hides it. Bump `id` when the message changes, so people who dismissed the old one see the new one. |
|
||||||
| History page decade headers | `src/data/historyDecades.ts` | Title, tagline and blurb per decade. |
|
| History page decade headers | `src/data/historyDecades.ts` | Title, tagline and blurb per decade. |
|
||||||
| Chapter map tiles and area names | `src/data/mapGrid.ts` | `AREAS` (tile positions) and `AREA_NAMES`. Which region paints which tile is in the database (Admin → Data → Organizations → a region → Map areas). |
|
| Chapter map tiles and area names | `src/data/mapGrid.ts` | `AREAS` (tile positions) and `AREA_NAMES`. Which region paints which tile is in the database (Admin → Data → Organizations → a region → Map areas). |
|
||||||
| Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. |
|
| Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. `DATA_REQUEST` ('privacy') isn't a tile: the Privacy page's form sends it, and the server requires an email for it. |
|
||||||
|
| Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. |
|
||||||
| Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. |
|
| Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. |
|
||||||
| Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | |
|
| Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | |
|
||||||
| Organization kind labels ("Region", "Chapter") | `ORG_KIND_LABEL` in `src/lib/hrefs.ts` | |
|
| Organization kind labels ("Region", "Chapter") | `ORG_KIND_LABEL` in `src/lib/hrefs.ts` | |
|
||||||
|
|
|
||||||
|
|
@ -935,6 +935,7 @@ const siteSettings = {
|
||||||
text("favicon"),
|
text("favicon"),
|
||||||
text("apple_touch_icon"),
|
text("apple_touch_icon"),
|
||||||
enumeration("indexing", ["on", "off"]),
|
enumeration("indexing", ["on", "off"]),
|
||||||
|
text("privacy_email"),
|
||||||
],
|
],
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
11
server/src/migrations/039_privacy_contact.sql
Normal file
11
server/src/migrations/039_privacy_contact.sql
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
-- ═══════════════════════════════════════════════════════════════
|
||||||
|
-- 039 PRIVACY CONTACT
|
||||||
|
--
|
||||||
|
-- The address the Privacy page gives for privacy questions and data
|
||||||
|
-- requests (Panel → Site settings). Null falls back to site.json's
|
||||||
|
-- privacyEmail; blank in both, the page points to its request form
|
||||||
|
-- only. Data requests themselves are feedback rows of type
|
||||||
|
-- 'privacy' (routes/feedback.js), triaged in Admin → Feedback.
|
||||||
|
-- ═══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
ALTER TABLE site_settings ADD COLUMN privacy_email TEXT;
|
||||||
|
|
@ -102,12 +102,13 @@ export function siteFor(db) {
|
||||||
...base.robots,
|
...base.robots,
|
||||||
index: row.indexing ? row.indexing === "on" : base.robots?.index !== false,
|
index: row.indexing ? row.indexing === "on" : base.robots?.index !== false,
|
||||||
},
|
},
|
||||||
|
privacyEmail: row.privacy_email || base.privacyEmail || "",
|
||||||
pages,
|
pages,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* What the browser app reads for headings and titles. */
|
/* What the browser app reads for headings and titles. */
|
||||||
const forBrowser = (site) => ({ title: site.title, pages: site.pages });
|
const forBrowser = (site) => ({ title: site.title, pages: site.pages, privacyEmail: site.privacyEmail });
|
||||||
|
|
||||||
/* robots.txt for this database's setting, as the build writes it. */
|
/* robots.txt for this database's setting, as the build writes it. */
|
||||||
export function robotsTxt(site) {
|
export function robotsTxt(site) {
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,10 @@ const LIMITS = {
|
||||||
|
|
||||||
const MIN_MESSAGE = 10;
|
const MIN_MESSAGE = 10;
|
||||||
|
|
||||||
// Must match FEEDBACK_TYPES in src/pages/sections/FeedbackForm.jsx.
|
// Must match FEEDBACK_TYPES and DATA_REQUEST in src/data/feedbackTypes.ts.
|
||||||
// Anything else falls back to 'general' rather than being rejected,
|
// Anything else falls back to 'general' rather than being rejected,
|
||||||
// a renamed option shouldn't lose someone's submission.
|
// a renamed option shouldn't lose someone's submission.
|
||||||
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other"];
|
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other", "privacy"];
|
||||||
|
|
||||||
/* ── Input cleaning ──────────────────────────────────────────── */
|
/* ── Input cleaning ──────────────────────────────────────────── */
|
||||||
|
|
||||||
|
|
@ -76,6 +76,10 @@ feedback.post("/", async (c) => {
|
||||||
const errors = {};
|
const errors = {};
|
||||||
if (message.length < MIN_MESSAGE) errors.message = "Please write a little more.";
|
if (message.length < MIN_MESSAGE) errors.message = "Please write a little more.";
|
||||||
if (!looksLikeEmail(email)) errors.email = "That email doesn't look right.";
|
if (!looksLikeEmail(email)) errors.email = "That email doesn't look right.";
|
||||||
|
// A data request (Privacy page) has to be answerable.
|
||||||
|
else if (feedbackType === "privacy" && !email) {
|
||||||
|
errors.email = "We need an email address to reply to a data request.";
|
||||||
|
}
|
||||||
|
|
||||||
if (Object.keys(errors).length > 0) {
|
if (Object.keys(errors).length > 0) {
|
||||||
return c.json({ error: "Validation failed", fields: errors }, 422);
|
return c.json({ error: "Validation failed", fields: errors }, 422);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"title": "Next Generation of Unity",
|
"title": "Next Generation of Unity",
|
||||||
"url": "https://nextgenerationofunity.org",
|
"url": "https://nextgenerationofunity.org",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"privacyEmail": "",
|
||||||
"robots": {
|
"robots": {
|
||||||
"index": true
|
"index": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
|
||||||
import Banner from "./Banner.tsx";
|
import Banner from "./Banner.tsx";
|
||||||
import nguLogo from "../assets/logos/NGU_Logo.svg";
|
import nguLogo from "../assets/logos/NGU_Logo.svg";
|
||||||
import Footer from "./Footer.tsx";
|
import Footer from "./Footer.tsx";
|
||||||
|
import PrivacyNotice from "./PrivacyNotice.tsx";
|
||||||
|
|
||||||
/* ── Right-side nav actions ──────────────────────────────── */
|
/* ── Right-side nav actions ──────────────────────────────── */
|
||||||
|
|
||||||
|
|
@ -269,6 +270,7 @@ export default function Layout() {
|
||||||
{/*Site Footer applied to every page*/}
|
{/*Site Footer applied to every page*/}
|
||||||
<div inert={mobileMenuOpen}>
|
<div inert={mobileMenuOpen}>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
<PrivacyNotice />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Mobile menu */}
|
{/* Mobile menu */}
|
||||||
|
|
|
||||||
46
src/components/LegalText.tsx
Normal file
46
src/components/LegalText.tsx
Normal 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>
|
||||||
|
)
|
||||||
|
}
|
||||||
63
src/components/PrivacyNotice.tsx
Normal file
63
src/components/PrivacyNotice.tsx
Normal 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>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -80,6 +80,8 @@ function Avatar({ person, size }: { person: NonNullable<ContentBlockItem['person
|
||||||
|
|
||||||
function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
|
function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
|
// Google's map loads only when asked for (Privacy page).
|
||||||
|
const [showMap, setShowMap] = useState(false)
|
||||||
const panelId = useId()
|
const panelId = useId()
|
||||||
const graphic = blockMedia(entry.media)
|
const graphic = blockMedia(entry.media)
|
||||||
const place = entry.map?.trim()
|
const place = entry.map?.trim()
|
||||||
|
|
@ -169,13 +171,25 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
|
||||||
|
|
||||||
{place && (
|
{place && (
|
||||||
<div>
|
<div>
|
||||||
<iframe
|
{showMap ? (
|
||||||
src={mapEmbed(place)}
|
<iframe
|
||||||
title={`Map: ${place}`}
|
src={mapEmbed(place)}
|
||||||
loading="lazy"
|
title={`Map: ${place}`}
|
||||||
referrerPolicy="no-referrer-when-downgrade"
|
loading="lazy"
|
||||||
className="aspect-video w-full rounded-lg border-0"
|
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
|
<a
|
||||||
href={mapLink(place)}
|
href={mapLink(place)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@
|
||||||
the server isn't in this workspace, and it's the thing that
|
the server isn't in this workspace, and it's the thing that
|
||||||
decides what's storable.
|
decides what's storable.
|
||||||
|
|
||||||
|
DATA_REQUEST is kept out of the tiles: the Privacy page's form
|
||||||
|
sends it (FeedbackForm's fixedType), with an email required.
|
||||||
|
|
||||||
'general' isn't offered anywhere; it's the server's fallback for
|
'general' isn't offered anywhere; it's the server's fallback for
|
||||||
a type it doesn't recognise, so old rows still read sensibly.
|
a type it doesn't recognise, so old rows still read sensibly.
|
||||||
═══════════════════════════════════════════════════════════════ */
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
@ -44,7 +47,13 @@ export const FEEDBACK_TYPES = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const BY_ID = new Map(FEEDBACK_TYPES.map((t) => [t.id, t.label]));
|
export const DATA_REQUEST = {
|
||||||
|
id: "privacy",
|
||||||
|
label: "Privacy or data request",
|
||||||
|
hint: "A question about your data, or a request to see or delete it",
|
||||||
|
};
|
||||||
|
|
||||||
|
const BY_ID = new Map([...FEEDBACK_TYPES, DATA_REQUEST].map((t) => [t.id, t.label]));
|
||||||
|
|
||||||
export function feedbackTypeLabel(id) {
|
export function feedbackTypeLabel(id) {
|
||||||
return BY_ID.get(id) ?? (id === "general" ? "Unsorted" : id);
|
return BY_ID.get(id) ?? (id === "general" ? "Unsorted" : id);
|
||||||
|
|
|
||||||
|
|
@ -1710,6 +1710,18 @@ const siteSettings = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
legend: "Privacy",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
path: "privacy_email",
|
||||||
|
label: "Privacy contact email",
|
||||||
|
help: `The Privacy page gives this for privacy questions and data requests, eg. privacy@nextgenerationofunity.org. ${
|
||||||
|
siteConfiguration.privacyEmail ? `Default: ${siteConfiguration.privacyEmail}` : "Default: none, the page offers its request form only"
|
||||||
|
}.`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import siteConfiguration from '../../site.json'
|
||||||
|
|
||||||
type PageText = { title: string; description: string }
|
type PageText = { title: string; description: string }
|
||||||
|
|
||||||
type SiteText = { title?: string; pages?: Record<string, PageText> }
|
type SiteText = { title?: string; pages?: Record<string, PageText>; privacyEmail?: string }
|
||||||
|
|
||||||
/* What the server wrote into the page, if it did. */
|
/* What the server wrote into the page, if it did. */
|
||||||
const fromServer: SiteText =
|
const fromServer: SiteText =
|
||||||
|
|
@ -34,12 +34,15 @@ export const SITE_NAME: string = fromServer.title || siteConfiguration.title
|
||||||
|
|
||||||
export const SITE_ORIGIN: string = siteConfiguration.url
|
export const SITE_ORIGIN: string = siteConfiguration.url
|
||||||
|
|
||||||
|
/** Where privacy questions and data requests go (Panel → Site
|
||||||
|
* settings, else site.json). Blank: the Privacy page's form only. */
|
||||||
|
export const PRIVACY_EMAIL: string = fromServer.privacyEmail ?? siteConfiguration.privacyEmail
|
||||||
|
|
||||||
/** A site path as a full URL on the live site. */
|
/** A site path as a full URL on the live site. */
|
||||||
export const siteUrl = (path: string): string => new URL(path, SITE_ORIGIN).href
|
export const siteUrl = (path: string): string => new URL(path, SITE_ORIGIN).href
|
||||||
|
|
||||||
const PAGES: Record<string, PageText> = { ...siteConfiguration.pages, ...fromServer.pages }
|
const PAGES: Record<string, PageText> = { ...siteConfiguration.pages, ...fromServer.pages }
|
||||||
|
|
||||||
/** The static pages site.json knows, for the admin's page list. */
|
|
||||||
/** A static page's title and intro, from site.json's "pages". */
|
/** A static page's title and intro, from site.json's "pages". */
|
||||||
export function sitePage(path: string): PageText {
|
export function sitePage(path: string): PageText {
|
||||||
const page = PAGES[path]
|
const page = PAGES[path]
|
||||||
|
|
|
||||||
|
|
@ -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 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. */
|
/* Title and intro: site.json, which also gives the search metadata. */
|
||||||
const PAGE = sitePage("/privacy");
|
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 = [
|
const SECTIONS = [
|
||||||
{
|
{
|
||||||
id: "privacy",
|
id: "privacy",
|
||||||
title: "Privacy Policy",
|
title: "Privacy Policy",
|
||||||
blurb: "Last updated: [date]",
|
blurb: `Last updated: ${LAST_UPDATED}`,
|
||||||
accent: "#0f7183",
|
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",
|
background: "#eef9fb",
|
||||||
content: (
|
content: (
|
||||||
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">
|
<div className="mx-auto max-w-3xl px-6">
|
||||||
{/* Policy text goes here */}
|
<FeedbackForm fixedType={DATA_REQUEST.id} />
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function PrivacyPage() {
|
export default function PrivacyPage() {
|
||||||
return (
|
return <PageShell title={PAGE.title} intro={PAGE.description} sections={SECTIONS} />;
|
||||||
<PageShell
|
|
||||||
title={PAGE.title}
|
|
||||||
intro={PAGE.description}
|
|
||||||
sections={SECTIONS}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 PageShell from "../components/PageShell.tsx";
|
||||||
import { sitePage } from "../lib/site.ts";
|
import { sitePage } from "../lib/site.ts";
|
||||||
|
|
||||||
/* Title and intro: site.json, which also gives the search metadata. */
|
/* Title and intro: site.json, which also gives the search metadata. */
|
||||||
const PAGE = sitePage("/terms");
|
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 = [
|
const SECTIONS = [
|
||||||
{
|
{
|
||||||
id: "terms",
|
id: "terms",
|
||||||
title: "Terms of Service",
|
title: "Terms of Service",
|
||||||
blurb: "Last updated: [date]",
|
blurb: `Last updated: ${LAST_UPDATED}`,
|
||||||
accent: "#0f7183",
|
accent: "#0f7183",
|
||||||
background: "#eef9fb",
|
background: "#ffffff",
|
||||||
content: (
|
content: <LegalText parts={PARTS} />,
|
||||||
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">
|
|
||||||
{/* Terms text goes here */}
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function TermsPage() {
|
export default function TermsPage() {
|
||||||
return (
|
return <PageShell title={PAGE.title} intro={PAGE.description} sections={SECTIONS} />;
|
||||||
<PageShell
|
|
||||||
title={PAGE.title}
|
|
||||||
intro={PAGE.description}
|
|
||||||
sections={SECTIONS}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,16 @@
|
||||||
|
|
||||||
The page and section options come from navConfig, so adding a
|
The page and section options come from navConfig, so adding a
|
||||||
page to the nav adds it to this form too.
|
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 { useState } from "react";
|
||||||
import { post, ApiError } from "../../lib/api.ts";
|
import { post, ApiError } from "../../lib/api.ts";
|
||||||
import { PAGE_LINKS, PAGE_SECTIONS } from "../../navConfig.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 ACCENT = "#0f7183";
|
||||||
const MUTED = "#4a6b72";
|
const MUTED = "#4a6b72";
|
||||||
|
|
@ -216,8 +220,9 @@ function describeLocation(page, section) {
|
||||||
|
|
||||||
/* ── The form ────────────────────────────────────────────────── */
|
/* ── The form ────────────────────────────────────────────────── */
|
||||||
|
|
||||||
export default function FeedbackForm() {
|
export default function FeedbackForm({ fixedType }: { fixedType?: string } = {}) {
|
||||||
const [type, setType] = useState<any>(null);
|
const request = fixedType === DATA_REQUEST.id;
|
||||||
|
const [type, setType] = useState<any>(fixedType ?? null);
|
||||||
const [page, setPage] = useState(SITE_WIDE);
|
const [page, setPage] = useState(SITE_WIDE);
|
||||||
const [section, setSection] = useState(WHOLE_PAGE);
|
const [section, setSection] = useState(WHOLE_PAGE);
|
||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
|
|
@ -233,7 +238,8 @@ export default function FeedbackForm() {
|
||||||
const [fieldErrors, setFieldErrors] = useState<any>({});
|
const [fieldErrors, setFieldErrors] = useState<any>({});
|
||||||
|
|
||||||
const sending = status === "sending";
|
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) {
|
async function handleSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -271,7 +277,7 @@ export default function FeedbackForm() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
setType(null);
|
setType(fixedType ?? null);
|
||||||
setPage(SITE_WIDE);
|
setPage(SITE_WIDE);
|
||||||
setSection(WHOLE_PAGE);
|
setSection(WHOLE_PAGE);
|
||||||
setMessage("");
|
setMessage("");
|
||||||
|
|
@ -299,16 +305,18 @@ export default function FeedbackForm() {
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<p className="mt-3 max-w-prose" style={{ color: MUTED }}>
|
<p className="mt-3 max-w-prose" style={{ color: MUTED }}>
|
||||||
{email
|
{request
|
||||||
? `We'll follow up at ${email} if we have questions.`
|
? `We'll reply to ${email}. We may ask you to confirm it's you before we change or delete anything.`
|
||||||
: "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
|
: 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>
|
</p>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={reset}
|
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"
|
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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -320,28 +328,33 @@ export default function FeedbackForm() {
|
||||||
noValidate
|
noValidate
|
||||||
className="rounded-2xl border border-[#138ba0]/20 bg-white p-6 sm:p-8"
|
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">
|
<div className="mt-10">
|
||||||
<LocationPicker
|
<LocationPicker
|
||||||
page={page}
|
page={page}
|
||||||
section={section}
|
section={section}
|
||||||
onPageChange={setPage}
|
onPageChange={setPage}
|
||||||
onSectionChange={setSection}
|
onSectionChange={setSection}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Message */}
|
{/* Message */}
|
||||||
<div className="mt-10">
|
<div className={fixedType ? "" : "mt-10"}>
|
||||||
<label
|
<label
|
||||||
htmlFor="feedback-message"
|
htmlFor="feedback-message"
|
||||||
className="text-base font-semibold text-[#26454c]"
|
className="text-base font-semibold text-[#26454c]"
|
||||||
>
|
>
|
||||||
Tell us more
|
{request ? "Your request" : "Tell us more"}
|
||||||
</label>
|
</label>
|
||||||
<p className="mt-1 text-sm" style={{ color: MUTED }}>
|
<p className="mt-1 text-sm" style={{ color: MUTED }}>
|
||||||
What you expected to happen, and what happened instead, is the most
|
{request
|
||||||
useful thing you can give us.
|
? "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>
|
</p>
|
||||||
<textarea
|
<textarea
|
||||||
id="feedback-message"
|
id="feedback-message"
|
||||||
|
|
@ -349,7 +362,11 @@ export default function FeedbackForm() {
|
||||||
maxLength={MAX_CHARS}
|
maxLength={MAX_CHARS}
|
||||||
value={message}
|
value={message}
|
||||||
onChange={(e) => setMessage(e.target.value)}
|
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-invalid={Boolean(fieldErrors.message)}
|
||||||
aria-describedby={fieldErrors.message ? "feedback-message-error" : undefined}
|
aria-describedby={fieldErrors.message ? "feedback-message-error" : undefined}
|
||||||
className={`mt-4 resize-y ${fieldClass} ${
|
className={`mt-4 resize-y ${fieldClass} ${
|
||||||
|
|
@ -370,12 +387,15 @@ export default function FeedbackForm() {
|
||||||
{/* Optional contact details */}
|
{/* 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="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">
|
<div className="flex flex-wrap items-center">
|
||||||
<h3 className="text-base font-semibold text-[#26454c]">Your details</h3>
|
<h3 className="text-base font-semibold text-[#26454c]">
|
||||||
<OptionalTag />
|
{request ? "How we reach you" : "Your details"}
|
||||||
|
</h3>
|
||||||
|
{!request && <OptionalTag />}
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
|
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
|
||||||
Leave these blank and your feedback comes through anonymously. Fill
|
{request
|
||||||
them in only if you'd like a reply, we won't add you to any list.
|
? "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>
|
</p>
|
||||||
|
|
||||||
<div className="mt-5 grid gap-4 sm:grid-cols-2">
|
<div className="mt-5 grid gap-4 sm:grid-cols-2">
|
||||||
|
|
@ -400,12 +420,14 @@ export default function FeedbackForm() {
|
||||||
htmlFor="feedback-email"
|
htmlFor="feedback-email"
|
||||||
className="block text-sm font-medium text-[#26454c]"
|
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>
|
</label>
|
||||||
<input
|
<input
|
||||||
id="feedback-email"
|
id="feedback-email"
|
||||||
type="email"
|
type="email"
|
||||||
autoComplete="email"
|
autoComplete="email"
|
||||||
|
required={request}
|
||||||
value={email}
|
value={email}
|
||||||
onChange={(e) => setEmail(e.target.value)}
|
onChange={(e) => setEmail(e.target.value)}
|
||||||
aria-invalid={Boolean(fieldErrors.email)}
|
aria-invalid={Boolean(fieldErrors.email)}
|
||||||
|
|
@ -449,11 +471,13 @@ export default function FeedbackForm() {
|
||||||
disabled={!ready || sending}
|
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"
|
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>
|
</button>
|
||||||
{!ready && !sending && (
|
{!ready && !sending && (
|
||||||
<p className="text-sm" style={{ color: MUTED }}>
|
<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>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ import { useEffect, useState, type CSSProperties } from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
import HomeLink from './HomeLink.tsx'
|
import HomeLink from './HomeLink.tsx'
|
||||||
|
import VideoPlayer from '../../../components/VideoPlayer.tsx'
|
||||||
import DoveMark from '../../../components/DoveMark.tsx'
|
import DoveMark from '../../../components/DoveMark.tsx'
|
||||||
import PlatformIcon from '../../../components/PlatformIcon.tsx'
|
import PlatformIcon from '../../../components/PlatformIcon.tsx'
|
||||||
import { livestreamEmbedUrl, videoSource, type VideoSource } from '../../../lib/embeds.ts'
|
import { livestreamEmbedUrl, videoSource, type VideoSource } from '../../../lib/embeds.ts'
|
||||||
|
|
@ -352,14 +353,17 @@ function PhotoBackdrop({ slides, seconds }: { slides: HeroSlide[]; seconds: numb
|
||||||
|
|
||||||
/* ── Livestream ──────────────────────────────────────────────── */
|
/* ── 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 }) {
|
function LiveFrame({ src, url, title }: { src: string | null; url: string; title?: string | null }) {
|
||||||
|
const [watching, setWatching] = useState(false)
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="relative overflow-hidden rounded-3xl border border-white/15 bg-black shadow-2xl"
|
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)' }}
|
style={{ boxShadow: '0 30px 80px -20px rgba(16, 212, 138, 0.35)' }}
|
||||||
>
|
>
|
||||||
<div className="aspect-video w-full">
|
<div className="aspect-video w-full">
|
||||||
{src ? (
|
{src && watching ? (
|
||||||
<iframe
|
<iframe
|
||||||
src={src}
|
src={src}
|
||||||
title={title || 'Livestream'}
|
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"
|
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
|
||||||
allowFullScreen
|
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">
|
<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" />
|
<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
|
/* A file plays in <video> with the browser's controls; preload
|
||||||
"metadata" fetches enough for the first frame and the length,
|
"metadata" fetches enough for the first frame and the length,
|
||||||
not the whole file. An embed waits for play. A link that is
|
not the whole file. An embed is a VideoPlayer: a still until
|
||||||
neither still gets a button out to it. */
|
pressed, so the video's host sets nothing before then. A link
|
||||||
|
that is neither still gets a button out to it. */
|
||||||
function VideoFrame({
|
function VideoFrame({
|
||||||
source,
|
source,
|
||||||
url,
|
url,
|
||||||
|
|
@ -414,13 +430,7 @@ function VideoFrame({
|
||||||
preload="metadata"
|
preload="metadata"
|
||||||
/>
|
/>
|
||||||
) : source?.kind === 'embed' ? (
|
) : source?.kind === 'embed' ? (
|
||||||
<iframe
|
<VideoPlayer url={url} title={title || 'Featured video'} className="h-full" />
|
||||||
src={source.src}
|
|
||||||
title={title || 'Featured video'}
|
|
||||||
className="h-full w-full"
|
|
||||||
allow="encrypted-media; picture-in-picture; fullscreen"
|
|
||||||
allowFullScreen
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<div className="flex h-full w-full items-center justify-center">
|
<div className="flex h-full w-full items-center justify-center">
|
||||||
<HomeLink
|
<HomeLink
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue