NGU-Web/src/pages/Giving.tsx
Zaldimmar 6fc19d7ee3 One palette backdrop behind every page; flat hero, split hero buttons
PageBackdrop draws flat, overlapping palette circles behind the
public site and eases them to a new tone as each section reaches
the middle of the window, so sections no longer paint their own
bands (PageShell's background field is gone). The hero's brand
backdrop is a flat teal with the dove, its two buttons one cell cut
by a slash, and the countdown straddles the hero and the band
below. No glows: the drifting blobs, rings, live-dot pulse and the
stats band's blurred circle are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 14:46:48 -05:00

92 lines
3.3 KiB
TypeScript

import { useEffect } from "react";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import { BRAND } from "../lib/color.ts"
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/give");
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&rsquo;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
</a>
<p className="mt-4 text-sm text-muted">
If you would like to send a check, please email our Board Treasurer at treasurer@nextgenerationofunity.org to get an address.
</p>
</div>
);
}
/* ═══════════════════════════════════════════════════════════════
PAGE
═══════════════════════════════════════════════════════════════ */
export default function GivingPage() {
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}
sections={sections}
/>
);
}