Page management, step 2: the core pages as sections
Migrations 081 and 082: Feedback, Request, QR codes, Give, Privacy and Terms become pages of sections. Their forms and embeds are section types any page can use; Give's words and all of Privacy and Terms become blocks. The privacy contact email is written into the policy and its setting goes. Core pages keep their address and can't be deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1342691f49
commit
f33c0008fe
27 changed files with 298 additions and 645 deletions
|
|
@ -1,46 +0,0 @@
|
|||
import PageShell from "../components/PageShell.tsx";
|
||||
import type { PageText } from "./fixedPages.ts";
|
||||
import FeedbackForm from "./sections/FeedbackForm.tsx";
|
||||
import { BRAND } from "../lib/color.ts"
|
||||
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
Feedback page.
|
||||
|
||||
Section ids match the nav hashes. Right now there's one:
|
||||
#website. Add more entries to SECTIONS as the page grows,
|
||||
program feedback, retreat surveys, etc.
|
||||
|
||||
The form itself lives in sections/FeedbackForm, including its
|
||||
own type list, location picker, and the POST to /api/feedback.
|
||||
This file only decides where it sits on the page.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
|
||||
const SECTIONS = [
|
||||
{
|
||||
id: "website",
|
||||
title: "Website Feedback",
|
||||
blurb:
|
||||
"Found a broken link, spotted something out of date, or want the site to do something it doesn't? This form goes straight to the people who maintain it.",
|
||||
accent: BRAND,
|
||||
content: (
|
||||
// Narrower than the usual max-w-6xl: full-width form fields
|
||||
// are unpleasant to fill in.
|
||||
<div className="mx-auto max-w-3xl px-6">
|
||||
<FeedbackForm />
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
/* Its title and intro: its site_pages row (Pages → Page management). */
|
||||
export default function Feedback({ page: PAGE }: { page: PageText }) {
|
||||
return (
|
||||
<PageShell
|
||||
title={PAGE.title}
|
||||
intro={PAGE.description ?? undefined}
|
||||
sections={SECTIONS}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
import { useEffect } from "react";
|
||||
import PageShell from "../components/PageShell.tsx";
|
||||
import type { PageText } from "./fixedPages.ts";
|
||||
import { BRAND } from "../lib/color.ts"
|
||||
|
||||
|
||||
const GIVING_URL =
|
||||
"https://ngu.churchcenteronline.com/giving?open-in-church-center-modal=true";
|
||||
|
||||
const MODAL_SCRIPT_SRC = "https://js.churchcenter.com/modal/v1";
|
||||
|
||||
|
||||
function useChurchCenterModal() {
|
||||
useEffect(() => {
|
||||
if (document.querySelector(`script[src="${MODAL_SCRIPT_SRC}"]`)) return;
|
||||
|
||||
const script = document.createElement("script");
|
||||
script.src = MODAL_SCRIPT_SRC;
|
||||
script.async = true;
|
||||
document.head.appendChild(script);
|
||||
|
||||
// Deliberately not removed on unmount: the script registers a
|
||||
// document-level click handler, and tearing it down on every
|
||||
// route change would mean re-fetching it on the way back.
|
||||
}, []);
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
GIVING SECTION
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
function GivingPanel() {
|
||||
return (
|
||||
<div className="max-w-2xl mx-auto px-6 text-center">
|
||||
<p className="text-body leading-relaxed">
|
||||
Gifts are processed securely through Church Center. The form opens
|
||||
right here on the page and you can give once or set up a recurring
|
||||
gift, and you don’t need an account to do either.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href={GIVING_URL}
|
||||
className="
|
||||
mt-8 inline-flex items-center justify-center
|
||||
btn px-10 py-4
|
||||
text-base font-semibold tracking-wide text-white
|
||||
shadow-sm transition
|
||||
hover:brightness-110 hover:shadow-md
|
||||
focus-visible:outline-none focus-visible:ring-2
|
||||
focus-visible:ring-offset-2
|
||||
motion-reduce:transition-none
|
||||
"
|
||||
style={{ backgroundColor: BRAND, "--tw-ring-color": BRAND } as React.CSSProperties}
|
||||
>
|
||||
Give through Church Center
|
||||
</a>
|
||||
|
||||
<p className="mt-4 text-sm text-muted">
|
||||
If you would like to send a check, please email our Board Treasurer at{" "}
|
||||
<a href="mailto:treasurer@nextgenerationofunity.org" className="text-link underline">
|
||||
treasurer@nextgenerationofunity.org
|
||||
</a>{" "}
|
||||
to get an address.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
PAGE
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
/* Its title and intro: its site_pages row (Pages → Page management). */
|
||||
export default function GivingPage({ page: PAGE }: { page: PageText }) {
|
||||
useChurchCenterModal();
|
||||
|
||||
const sections = [
|
||||
{
|
||||
id: "give",
|
||||
title: "Give to NGU",
|
||||
blurb:
|
||||
"Your giving funds scholarships, retreats, leadership development and the continued growth of the Next Generation of Unity leaders, teachers and community members.",
|
||||
accent: BRAND,
|
||||
content: <GivingPanel />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageShell
|
||||
title={PAGE.title}
|
||||
intro={PAGE.description ?? undefined}
|
||||
sections={sections}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -2,16 +2,14 @@
|
|||
PAGE AT PATH: any address the record routes don't take
|
||||
|
||||
Pages → Page management decides what's where: the site_pages row
|
||||
at this path (useSiteNav) is drawn by its code when it's one of
|
||||
the fixed pages (fixedPages.ts), or as its sections (SitePage).
|
||||
No page there (or a hidden one, below viewer, which isn't sent):
|
||||
Not found.
|
||||
at this path (useSiteNav), drawn as its sections (SitePage). The
|
||||
front page is the index route of its own (Home.tsx). No page there
|
||||
(or a hidden one, below viewer, which isn't sent): Not found.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
import { useSiteNav } from '../lib/useSiteNav.ts'
|
||||
import { FIXED_PAGES } from './fixedPages.ts'
|
||||
import NotFound from './NotFound.tsx'
|
||||
import SitePage from './SitePage.tsx'
|
||||
|
||||
|
|
@ -24,8 +22,5 @@ export default function PageAtPath() {
|
|||
|
||||
const page = pageAt(pathname)
|
||||
if (!page || page.path === '/') return <NotFound />
|
||||
|
||||
const Fixed = FIXED_PAGES[page.id]
|
||||
if (Fixed) return <Fixed key={page.id} page={page} />
|
||||
return <SitePage key={page.id} id={page.id} />
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,215 +0,0 @@
|
|||
import { Link } from "react-router-dom";
|
||||
|
||||
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
|
||||
import PageShell from "../components/PageShell.tsx";
|
||||
import { DATA_REQUEST } from "../data/feedbackTypes.ts";
|
||||
import { PRIVACY_EMAIL } from "../lib/site.ts";
|
||||
import type { PageText } from "./fixedPages.ts";
|
||||
import FeedbackForm from "./sections/FeedbackForm.tsx";
|
||||
import { BRAND } from "../lib/color.ts"
|
||||
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
Privacy policy, cookie notice included.
|
||||
|
||||
What it says must stay true of the code: what the feedback and
|
||||
request forms store (routes/feedback.js, routes/requests.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 → Forms → Data requests.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
const LAST_UPDATED = "October 3, 2026";
|
||||
|
||||
const link = "underline underline-offset-2 text-link";
|
||||
|
||||
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. Files you attach to a <Link to="/request" className={link}>request</Link> are kept with it.
|
||||
</>,
|
||||
<>
|
||||
<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, groups 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), at{" "}
|
||||
<a href="https://ngu.churchcenteronline.com" className="text-link underline underline-offset-2">
|
||||
ngu.churchcenteronline.com
|
||||
</a>
|
||||
. Payment details go to them, not to us. Church Center's script loads when you open our Giving page,
|
||||
and its giving form opens when you press Give; Church Center may use Google Analytics in that form,
|
||||
under its own privacy policy.
|
||||
</>,
|
||||
<>
|
||||
<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.
|
||||
</>,
|
||||
<>
|
||||
<strong>Files attached to requests</strong> are stored in our Google Workspace (Google Drive), and
|
||||
our staff may be told of a new request by email through it.
|
||||
</>,
|
||||
],
|
||||
after: [
|
||||
"This site runs on a server we rent and manage ourselves; your information is stored there, not with an outside website service, apart from request files as above.",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "cookies",
|
||||
heading: "Cookies and browser storage",
|
||||
body: [
|
||||
<>
|
||||
This site doesn't use advertising or tracking cookies, and doesn't use Google Analytics. To see which
|
||||
pages are read, we use{" "}
|
||||
<a href="https://plausible.io" className="text-link underline underline-offset-2">
|
||||
Plausible Analytics
|
||||
</a>
|
||||
, which we host ourselves on our own server using its free, open-source{" "}
|
||||
<a
|
||||
href="https://github.com/plausible/community-edition/"
|
||||
className="text-link underline underline-offset-2"
|
||||
>
|
||||
Community Edition
|
||||
</a>
|
||||
: it sets no cookies, doesn't follow you across sites, and keeps no personal information, only counts
|
||||
of visits to each page; nothing from it is shared or sold. The site also 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.",
|
||||
"Your accessibility choices: the dyslexia-friendly font, reading mode and color blind mode.",
|
||||
"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: ${LAST_UPDATED}`,
|
||||
accent: BRAND,
|
||||
content: <LegalText parts={PARTS} />,
|
||||
},
|
||||
{
|
||||
id: "requests",
|
||||
title: "Data requests",
|
||||
blurb: "Ask to see, correct or delete the information we hold about you.",
|
||||
accent: BRAND,
|
||||
content: (
|
||||
<div className="mx-auto max-w-3xl px-6">
|
||||
<FeedbackForm fixedType={DATA_REQUEST.id} />
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
/* Its title and intro: its site_pages row (Pages → Page management). */
|
||||
export default function PrivacyPage({ page: PAGE }: { page: PageText }) {
|
||||
return <PageShell title={PAGE.title} intro={PAGE.description ?? undefined} sections={SECTIONS} />;
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
import PageShell from '../components/PageShell.tsx'
|
||||
import type { PageText } from './fixedPages.ts'
|
||||
import QrCodeMaker from './sections/QrCodeMaker.tsx'
|
||||
import { BRAND } from '../lib/color.ts'
|
||||
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
QR CODES PAGE: /qr
|
||||
|
||||
A QR code for any page on the site, for flyers, slides and
|
||||
signs. Unlisted: not in Pages → Navigation's links, so neither
|
||||
the header nor the footer links here. It lists only published records, so there is
|
||||
nothing on it a visitor couldn't already reach.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
const SECTIONS = [
|
||||
{
|
||||
id: 'make',
|
||||
title: 'Make a QR code',
|
||||
blurb:
|
||||
'Pick a page from the main navigation, any event, organization, team, award, person or blog post, or type any link. Site pages always point at the live site. Choose what sits in the center and the colors; a warning shows if the code might not scan.',
|
||||
accent: BRAND,
|
||||
content: (
|
||||
<div className="mx-auto max-w-6xl px-6">
|
||||
<QrCodeMaker />
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
/* Its title and intro: its site_pages row (Pages → Page management). */
|
||||
export default function QrCodes({ page: PAGE }: { page: PageText }) {
|
||||
return (
|
||||
<PageShell
|
||||
title={PAGE.title}
|
||||
intro={PAGE.description ?? undefined}
|
||||
sections={SECTIONS}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
import PageShell from "../components/PageShell.tsx";
|
||||
import type { PageText } from "./fixedPages.ts";
|
||||
import RequestForm from "./sections/RequestForm.tsx";
|
||||
import { BRAND } from "../lib/color.ts";
|
||||
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
Request page: ask for something to be added to the site or
|
||||
changed on it. The form (sections/RequestForm) reads ?type= to
|
||||
start on one kind of request; requestLink() makes those links.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
const SECTIONS = [
|
||||
{
|
||||
id: "request",
|
||||
title: "Send a request",
|
||||
blurb:
|
||||
"Tell us what you'd like on the site, or what should change. Attach a Word document with the details and we'll take it from there.",
|
||||
accent: BRAND,
|
||||
content: (
|
||||
<div className="mx-auto max-w-3xl px-6">
|
||||
<RequestForm />
|
||||
</div>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
/* Its title and intro: its site_pages row (Pages → Page management). */
|
||||
export default function Request({ page: PAGE }: { page: PageText }) {
|
||||
return <PageShell title={PAGE.title} intro={PAGE.description ?? undefined} sections={SECTIONS} />;
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ import EventListCards, { EventCardsToggle } from './sections/EventList-Cards.tsx
|
|||
import CommunityBlog from './sections/CommunityBlog.tsx'
|
||||
import HistoryTimeline from './sections/history/HistoryTimeline.tsx'
|
||||
import { DirectoryTabs, DIRECTORY_PREVIEW } from './sections/PeopleDirectory.tsx'
|
||||
import { DataRequestSection, FeedbackSection, GivingSection, QrSection, RequestSection } from './sections/FormSections.tsx'
|
||||
|
||||
/* Year the program starts: decades ending before it get the
|
||||
pre-program look on the timeline. */
|
||||
|
|
@ -94,6 +95,12 @@ const PRESETS: Record<string, (section: SitePageSection) => Record<string, any>>
|
|||
Component: DirectoryTabs,
|
||||
props: { tags: section.tag_ids, limit: DIRECTORY_PREVIEW },
|
||||
}),
|
||||
// What used to be whole pages (081): FormSections.tsx.
|
||||
feedback_form: () => ({ Component: FeedbackSection }),
|
||||
request_form: () => ({ Component: RequestSection }),
|
||||
data_request_form: () => ({ Component: DataRequestSection }),
|
||||
giving: () => ({ Component: GivingSection }),
|
||||
qr_maker: () => ({ Component: QrSection }),
|
||||
}
|
||||
|
||||
export default function SitePage({ id }: { id: string }) {
|
||||
|
|
|
|||
|
|
@ -1,92 +0,0 @@
|
|||
import { Link } from "react-router-dom";
|
||||
|
||||
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
|
||||
import PageShell from "../components/PageShell.tsx";
|
||||
import type { PageText } from "./fixedPages.ts";
|
||||
import { BRAND } from "../lib/color.ts"
|
||||
|
||||
|
||||
/* Change the date when the wording changes. */
|
||||
const LAST_UPDATED = "September 28, 2026";
|
||||
|
||||
const link = "underline underline-offset-2 text-link";
|
||||
|
||||
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: ${LAST_UPDATED}`,
|
||||
accent: BRAND,
|
||||
content: <LegalText parts={PARTS} />,
|
||||
},
|
||||
];
|
||||
|
||||
/* Its title and intro: its site_pages row (Pages → Page management). */
|
||||
export default function TermsPage({ page: PAGE }: { page: PageText }) {
|
||||
return <PageShell title={PAGE.title} intro={PAGE.description ?? undefined} sections={SECTIONS} />;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
FIXED PAGES
|
||||
|
||||
The pages the site still draws in code, by their site_pages id
|
||||
(Pages → Page management can rename, move, hide or disable them,
|
||||
not delete them: server/src/admin-schema/sitePages.js,
|
||||
FIXED_PAGES). Every other page is its sections (SitePage.tsx).
|
||||
Each takes its title and intro from its row. The front page is
|
||||
the index route of its own (Home.tsx).
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { lazy, type ComponentType } from 'react'
|
||||
|
||||
export type PageText = { title: string; description: string | null }
|
||||
|
||||
export const FIXED_PAGES: Record<string, ComponentType<{ page: PageText }>> = {
|
||||
give: lazy(() => import('./Giving.tsx')),
|
||||
feedback: lazy(() => import('./Feedback.tsx')),
|
||||
request: lazy(() => import('./Request.tsx')),
|
||||
qr: lazy(() => import('./QrCodes.tsx')),
|
||||
privacy: lazy(() => import('./Privacy.tsx')),
|
||||
terms: lazy(() => import('./Terms.tsx')),
|
||||
}
|
||||
82
src/pages/sections/FormSections.tsx
Normal file
82
src/pages/sections/FormSections.tsx
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
FORM AND EMBED SECTIONS
|
||||
|
||||
Section types (page_sections.preset, 081) for what used to be
|
||||
whole pages, so any page can have them: SitePage.tsx draws them
|
||||
under a section's blocks.
|
||||
|
||||
feedback_form the website feedback form
|
||||
request_form the request form (reads ?type=)
|
||||
data_request_form a request to see, correct or delete data
|
||||
giving the Church Center giving button
|
||||
qr_maker the QR code maker
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { useEffect } from 'react'
|
||||
|
||||
import FeedbackForm from './FeedbackForm.tsx'
|
||||
import RequestForm from './RequestForm.tsx'
|
||||
import QrCodeMaker from './QrCodeMaker.tsx'
|
||||
import { DATA_REQUEST } from '../../data/feedbackTypes.ts'
|
||||
import { BRAND } from '../../lib/color.ts'
|
||||
|
||||
/* A form reads best narrower than the page. */
|
||||
const Narrow = ({ children }: { children: React.ReactNode }) => <div className="mx-auto max-w-3xl px-6">{children}</div>
|
||||
|
||||
export const FeedbackSection = () => (
|
||||
<Narrow>
|
||||
<FeedbackForm />
|
||||
</Narrow>
|
||||
)
|
||||
|
||||
export const RequestSection = () => (
|
||||
<Narrow>
|
||||
<RequestForm />
|
||||
</Narrow>
|
||||
)
|
||||
|
||||
export const DataRequestSection = () => (
|
||||
<Narrow>
|
||||
<FeedbackForm fixedType={DATA_REQUEST.id} />
|
||||
</Narrow>
|
||||
)
|
||||
|
||||
export const QrSection = () => (
|
||||
<div className="mx-auto max-w-6xl px-6">
|
||||
<QrCodeMaker />
|
||||
</div>
|
||||
)
|
||||
|
||||
/* Giving: Church Center's modal script, loaded with the section, and
|
||||
the button that opens its form on the page. The words around it
|
||||
are the section's blocks. */
|
||||
const GIVING_URL = 'https://ngu.churchcenteronline.com/giving?open-in-church-center-modal=true'
|
||||
const MODAL_SCRIPT_SRC = 'https://js.churchcenter.com/modal/v1'
|
||||
|
||||
function useChurchCenterModal() {
|
||||
useEffect(() => {
|
||||
if (document.querySelector(`script[src="${MODAL_SCRIPT_SRC}"]`)) return
|
||||
const script = document.createElement('script')
|
||||
script.src = MODAL_SCRIPT_SRC
|
||||
script.async = true
|
||||
document.head.appendChild(script)
|
||||
// Deliberately not removed on unmount: the script registers a
|
||||
// document-level click handler, and tearing it down on every
|
||||
// route change would mean fetching it again on the way back.
|
||||
}, [])
|
||||
}
|
||||
|
||||
export function GivingSection() {
|
||||
useChurchCenterModal()
|
||||
return (
|
||||
<div className="mx-auto max-w-2xl px-6 text-center">
|
||||
<a
|
||||
href={GIVING_URL}
|
||||
className="inline-flex items-center justify-center btn px-10 py-4 text-base font-semibold tracking-wide text-white shadow-sm transition hover:brightness-110 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 motion-reduce:transition-none"
|
||||
style={{ backgroundColor: BRAND, '--tw-ring-color': BRAND } as React.CSSProperties}
|
||||
>
|
||||
Give through Church Center
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue