Page updates: v1.10.3 to v1.10.6 #20
15 changed files with 400 additions and 268 deletions
|
|
@ -268,7 +268,7 @@ The numbers band's "Number Source" dropdown works the same way:
|
||||||
| What | File | Notes |
|
| What | File | Notes |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Header and footer navigation, page subnav links | `src/navConfig.ts` | `PAGE_LINKS`, `PAGE_SECTIONS`, `NAV_ACTIONS`. A new page also needs a route in `src/App.tsx`. |
|
| Header and footer navigation, page subnav links | `src/navConfig.ts` | `PAGE_LINKS`, `PAGE_SECTIONS`, `NAV_ACTIONS`. A new page also needs a route in `src/App.tsx`. |
|
||||||
| Section titles, blurbs and colors on Retreats, Community, Leadership, Resources, Feedback, Privacy, Terms | the page file in `src/pages/` | the `SECTIONS` array at the top. A section's `id` must match its subnav `hash`. |
|
| Section titles, blurbs and colors on Retreats, Community, Organization, Resources, Feedback, Privacy, Terms | the page file in `src/pages/` | the `SECTIONS` array at the top. A section's `id` must match its subnav `hash`. |
|
||||||
| 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. |
|
||||||
| Group 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). |
|
| Group 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). |
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@
|
||||||
the app's own not-found page with a 404 status, so search engines
|
the app's own not-found page with a 404 status, so search engines
|
||||||
drop it.
|
drop it.
|
||||||
|
|
||||||
|
A page that moved answers with a 301 to where it is now (MOVED),
|
||||||
|
so old links, QR codes and search results keep working.
|
||||||
|
|
||||||
If the metadata can't be built (no site.json at SITE_CONFIG, say),
|
If the metadata can't be built (no site.json at SITE_CONFIG, say),
|
||||||
the page is still served, as built, and the cause is logged once:
|
the page is still served, as built, and the cause is logged once:
|
||||||
a preview is never worth a page that won't load.
|
a preview is never worth a page that won't load.
|
||||||
|
|
@ -89,12 +92,23 @@ pages.get("/sitemap.xml", (c) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Pages that have moved: old path → new, query string kept. */
|
||||||
|
const MOVED = {
|
||||||
|
"/leadership": "/organization",
|
||||||
|
};
|
||||||
|
|
||||||
pages.get("*", (c, next) => {
|
pages.get("*", (c, next) => {
|
||||||
const pathname = c.req.path;
|
const pathname = c.req.path;
|
||||||
// The API's own paths, and an upload that isn't there, stay plain
|
// The API's own paths, and an upload that isn't there, stay plain
|
||||||
// 404s rather than becoming a page.
|
// 404s rather than becoming a page.
|
||||||
if (/^\/(api|uploads)(\/|$)/.test(pathname)) return next();
|
if (/^\/(api|uploads)(\/|$)/.test(pathname)) return next();
|
||||||
|
|
||||||
|
const moved = MOVED[pathname.replace(/(.)\/+$/, "$1")];
|
||||||
|
if (moved) {
|
||||||
|
const query = new URL(c.req.url).search;
|
||||||
|
return c.redirect(moved + query, 301);
|
||||||
|
}
|
||||||
|
|
||||||
let html;
|
let html;
|
||||||
try {
|
try {
|
||||||
html = indexHtml();
|
html = indexHtml();
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@
|
||||||
"title": "Community",
|
"title": "Community",
|
||||||
"description": "Groups, regions and the people who make up Next Generation of Unity."
|
"description": "Groups, regions and the people who make up Next Generation of Unity."
|
||||||
},
|
},
|
||||||
"/leadership": {
|
"/organization": {
|
||||||
"title": "Leadership",
|
"title": "Organization",
|
||||||
"description": "The board, staff, and volunteers who keep Next Generation of Unity running."
|
"description": "Our mission, vision and values, the people who lead Next Generation of Unity, and how to reach us."
|
||||||
},
|
},
|
||||||
"/resources": {
|
"/resources": {
|
||||||
"title": "Resources",
|
"title": "Resources",
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ const lazyPage = (load) =>
|
||||||
)
|
)
|
||||||
const Retreats = lazyPage(() => import("./pages/Retreats.tsx"))
|
const Retreats = lazyPage(() => import("./pages/Retreats.tsx"))
|
||||||
const Community = lazyPage(() => import("./pages/Community.tsx"))
|
const Community = lazyPage(() => import("./pages/Community.tsx"))
|
||||||
const Leadership = lazyPage(() => import("./pages/Leadership.tsx"))
|
const Organization = lazyPage(() => import("./pages/Organization.tsx"))
|
||||||
const Resources = lazyPage(() => import("./pages/Resources.tsx"))
|
const Resources = lazyPage(() => import("./pages/Resources.tsx"))
|
||||||
const History = lazyPage(() => import("./pages/History.tsx"))
|
const History = lazyPage(() => import("./pages/History.tsx"))
|
||||||
const Feedback = lazyPage(() => import("./pages/Feedback.tsx"))
|
const Feedback = lazyPage(() => import("./pages/Feedback.tsx"))
|
||||||
|
|
@ -101,7 +101,7 @@ export default function App() {
|
||||||
<Route path="/awards/:id" element={<AwardDetail />} />
|
<Route path="/awards/:id" element={<AwardDetail />} />
|
||||||
<Route path="/people/:id" element={<PersonDetail />} />
|
<Route path="/people/:id" element={<PersonDetail />} />
|
||||||
<Route path="/blog/:id" element={<BlogPost />} />
|
<Route path="/blog/:id" element={<BlogPost />} />
|
||||||
<Route path="leadership" element={<Leadership />} />
|
<Route path="organization" element={<Organization />} />
|
||||||
<Route path="resources" element={<Resources />} />
|
<Route path="resources" element={<Resources />} />
|
||||||
<Route path="history" element={<History />} />
|
<Route path="history" element={<History />} />
|
||||||
<Route path="feedback" element={<Feedback />} />
|
<Route path="feedback" element={<Feedback />} />
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@
|
||||||
some.
|
some.
|
||||||
═══════════════════════════════════════════════════════════════ */
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
const CONTACT = 'info@nextgenerationofunity.org'
|
import { ORGANIZATION_DETAILS } from '../data/organizationDetails.ts'
|
||||||
|
|
||||||
|
const CONTACT = ORGANIZATION_DETAILS.email
|
||||||
|
|
||||||
export default function ComingSoon({ what }: { what: string }) {
|
export default function ComingSoon({ what }: { what: string }) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { Link } from "react-router-dom";
|
||||||
import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
|
import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
|
||||||
import siteLogo from "../assets/logos/NGU_Logo.svg";
|
import siteLogo from "../assets/logos/NGU_Logo.svg";
|
||||||
import PlatformIcon from "./PlatformIcon.tsx";
|
import PlatformIcon from "./PlatformIcon.tsx";
|
||||||
|
import { ORGANIZATION_DETAILS as Organization_Details } from "../data/organizationDetails.ts";
|
||||||
|
|
||||||
const Social_Links = [
|
const Social_Links = [
|
||||||
{ label: "Instagram", href: "https://www.instagram.com/nextgenerationunity/", platform: "instagram" },
|
{ label: "Instagram", href: "https://www.instagram.com/nextgenerationunity/", platform: "instagram" },
|
||||||
|
|
@ -22,19 +23,9 @@ type TouchLink = { label: string } & (
|
||||||
const Get_In_Touch: TouchLink[] = [
|
const Get_In_Touch: TouchLink[] = [
|
||||||
{ label: "Feedback", to: "/feedback"},
|
{ label: "Feedback", to: "/feedback"},
|
||||||
{ label: "Request", to: "/request" },
|
{ label: "Request", to: "/request" },
|
||||||
{ label: "Contact Us", to: "/leadership#contact" },
|
{ label: "Contact Us", to: "/organization#contact" },
|
||||||
];
|
];
|
||||||
|
|
||||||
/* Under the logo. The street address is where NGU is, not where
|
|
||||||
to send post, and says so. */
|
|
||||||
const Organization_Details = {
|
|
||||||
street: "1901 NW Blue Parkway",
|
|
||||||
cityLine: "Unity Village, MO 64065",
|
|
||||||
addressNote: "Physical address, not for mail",
|
|
||||||
nonprofit: "Next Generation of Unity is a qualified 501(c)(3) nonprofit organization.",
|
|
||||||
taxId: "33-2819320",
|
|
||||||
};
|
|
||||||
|
|
||||||
const Footer_Links = [
|
const Footer_Links = [
|
||||||
{ label: "Privacy Policy", to: "/privacy" },
|
{ label: "Privacy Policy", to: "/privacy" },
|
||||||
{ label: "Terms of Service", to: "/terms" },
|
{ label: "Terms of Service", to: "/terms" },
|
||||||
|
|
|
||||||
59
src/components/OrgContact.tsx
Normal file
59
src/components/OrgContact.tsx
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
/* ═══════════════════════════════════════════════════════════════
|
||||||
|
ORG CONTACT
|
||||||
|
|
||||||
|
An organization's ways to reach it, as buttons: its action links
|
||||||
|
filled in its accent, then its website, email and socials
|
||||||
|
outlined. Nothing at all when it has none. Used on an
|
||||||
|
organization's page and on the Organization page (NGU's own).
|
||||||
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
|
import PlatformIcon from './PlatformIcon.tsx'
|
||||||
|
import type { OrganizationRecord } from '../lib/useContent.ts'
|
||||||
|
import { accentText } from '../lib/color.ts'
|
||||||
|
|
||||||
|
export default function OrgContact({ org, accent }: { org: OrganizationRecord; accent: string }) {
|
||||||
|
const hasAny =
|
||||||
|
org.links.length > 0 || org.socials.length > 0 || org.website || org.email
|
||||||
|
|
||||||
|
if (!hasAny) return null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex flex-wrap gap-3">
|
||||||
|
{org.links.map((link) => (
|
||||||
|
<a
|
||||||
|
key={link.url}
|
||||||
|
href={link.url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="inline-flex items-center gap-2 btn px-5 py-2 text-sm text-white transition-transform hover:scale-105"
|
||||||
|
style={{ background: accent }}
|
||||||
|
>
|
||||||
|
<PlatformIcon platform={link.platform} />
|
||||||
|
{link.label}
|
||||||
|
</a>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* website and email arrive as bare strings (splitLinks in
|
||||||
|
shape.js); socials are whole link rows. */}
|
||||||
|
{[
|
||||||
|
org.website ? { url: org.website, label: 'Website', platform: null } : null,
|
||||||
|
org.email ? { url: `mailto:${org.email}`, label: org.email, platform: null } : null,
|
||||||
|
...org.socials,
|
||||||
|
]
|
||||||
|
.filter((link): link is NonNullable<typeof link> => Boolean(link))
|
||||||
|
.map((link) => (
|
||||||
|
<a
|
||||||
|
key={link.url}
|
||||||
|
href={link.url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="inline-flex items-center gap-2 btn border px-4 py-1.5 text-sm transition-colors hover:bg-tint"
|
||||||
|
style={{ borderColor: accent, color: accentText(accent) }}
|
||||||
|
>
|
||||||
|
<PlatformIcon platform={link.platform} />
|
||||||
|
{link.label}
|
||||||
|
</a>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
143
src/components/OrgTeams.tsx
Normal file
143
src/components/OrgTeams.tsx
Normal file
|
|
@ -0,0 +1,143 @@
|
||||||
|
/* ═══════════════════════════════════════════════════════════════
|
||||||
|
ORG TEAMS
|
||||||
|
|
||||||
|
An organization's leadership as people tiles, one block per team:
|
||||||
|
the team's name (linked to its page) and tagline, then its people.
|
||||||
|
Leadership arrives flat with team_id and team_name on each row,
|
||||||
|
so grouping costs nothing; `teams` gives the order and lists a
|
||||||
|
team with nobody in it yet. Used on an organization's page and on
|
||||||
|
the Organization page (NGU's own Board, Retreat Team and the rest).
|
||||||
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
|
import PeopleTiles from './PeopleTiles.tsx'
|
||||||
|
import type { Leader, OrganizationRecord } from '../lib/useContent.ts'
|
||||||
|
import { teamHref } from '../lib/hrefs.ts'
|
||||||
|
import { mediaUrl } from '../lib/media.ts'
|
||||||
|
import { accentText } from '../lib/color.ts'
|
||||||
|
|
||||||
|
const BODY = 'var(--color-muted)'
|
||||||
|
|
||||||
|
/* Whether the organization has any leadership to show. */
|
||||||
|
export const hasTeams = (org: OrganizationRecord) => groupLeadership(org).length > 0
|
||||||
|
|
||||||
|
export default function OrgTeams({ org, accent }: { org: OrganizationRecord; accent: string }) {
|
||||||
|
const teamBlocks = groupLeadership(org)
|
||||||
|
return (
|
||||||
|
<div className="space-y-12">
|
||||||
|
{teamBlocks.map((block) => (
|
||||||
|
<div key={block.key}>
|
||||||
|
<div className="mb-4">
|
||||||
|
{block.teamId ? (
|
||||||
|
<h3 className="text-xl font-bold">
|
||||||
|
<Link
|
||||||
|
to={teamHref(block.teamId)}
|
||||||
|
className="hover:underline"
|
||||||
|
style={{ color: accentText(accent) }}
|
||||||
|
>
|
||||||
|
{block.label}
|
||||||
|
</Link>
|
||||||
|
</h3>
|
||||||
|
) : (
|
||||||
|
block.label && (
|
||||||
|
<h3 className="text-xl font-bold" style={{ color: accentText(accent) }}>
|
||||||
|
{block.label}
|
||||||
|
</h3>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
{block.tagline && (
|
||||||
|
<p className="mt-1 text-sm" style={{ color: BODY }}>
|
||||||
|
{block.tagline}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{block.people.length > 0 ? (
|
||||||
|
<PeopleTiles
|
||||||
|
size="lg"
|
||||||
|
accent={block.accent || accent}
|
||||||
|
people={block.people.map((leader) => ({
|
||||||
|
id: leader.person_id,
|
||||||
|
name: leader.display_name,
|
||||||
|
title: leader.title,
|
||||||
|
pronouns: leader.pronouns,
|
||||||
|
public_email: leader.public_email,
|
||||||
|
photo: mediaUrl(leader.photo),
|
||||||
|
is_owner: leader.is_owner,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<p className="text-sm italic" style={{ color: BODY }}>
|
||||||
|
No members listed yet.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Leadership → team blocks ────────────────────────────────── */
|
||||||
|
|
||||||
|
type TeamBlock = {
|
||||||
|
key: string
|
||||||
|
teamId: string | null
|
||||||
|
label: string | null
|
||||||
|
tagline?: string | null
|
||||||
|
accent?: string | null
|
||||||
|
people: Leader[]
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Order comes from `teams` (the admin's sort_order), not from the
|
||||||
|
order people happen to appear in. Three cases to cover:
|
||||||
|
affiliations with no team at all, teams with nobody in them, and
|
||||||
|
people filed under a team that is no longer published. */
|
||||||
|
function groupLeadership(org: OrganizationRecord): TeamBlock[] {
|
||||||
|
const byTeam = new Map<string, Leader[]>()
|
||||||
|
const loose: Leader[] = []
|
||||||
|
|
||||||
|
for (const leader of org.leadership) {
|
||||||
|
if (!leader.team_id) {
|
||||||
|
loose.push(leader)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const list = byTeam.get(leader.team_id)
|
||||||
|
if (list) list.push(leader)
|
||||||
|
else byTeam.set(leader.team_id, [leader])
|
||||||
|
}
|
||||||
|
|
||||||
|
const blocks: TeamBlock[] = []
|
||||||
|
|
||||||
|
// People who hold a role in the organization without sitting on a
|
||||||
|
// team. Usually the leads. No heading, they are the page.
|
||||||
|
if (loose.length > 0) {
|
||||||
|
blocks.push({ key: 'loose', teamId: null, label: null, people: loose })
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const team of org.teams) {
|
||||||
|
blocks.push({
|
||||||
|
key: team.id,
|
||||||
|
teamId: team.id,
|
||||||
|
label: team.name,
|
||||||
|
tagline: team.tagline,
|
||||||
|
accent: team.color,
|
||||||
|
people: byTeam.get(team.id) ?? [],
|
||||||
|
})
|
||||||
|
byTeam.delete(team.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Whatever is left is filed under an unpublished team. Its page
|
||||||
|
// isn't reachable, so the heading is plain text, but the people
|
||||||
|
// are real and shouldn't silently vanish from the org.
|
||||||
|
for (const [teamId, people] of byTeam) {
|
||||||
|
blocks.push({
|
||||||
|
key: teamId,
|
||||||
|
teamId: null,
|
||||||
|
label: people[0]?.team_name ?? null,
|
||||||
|
people,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return blocks
|
||||||
|
}
|
||||||
17
src/data/organizationDetails.ts
Normal file
17
src/data/organizationDetails.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
/* ═══════════════════════════════════════════════════════════════
|
||||||
|
ORGANIZATION DETAILS
|
||||||
|
|
||||||
|
NGU's own address, nonprofit status and contact email, shown in
|
||||||
|
the footer and in the Organization page's Details & Contact. The
|
||||||
|
street address is where NGU is, not where to send post, and says
|
||||||
|
so.
|
||||||
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
|
export const ORGANIZATION_DETAILS = {
|
||||||
|
street: '1901 NW Blue Parkway',
|
||||||
|
cityLine: 'Unity Village, MO 64065',
|
||||||
|
addressNote: 'Physical address, not for mail',
|
||||||
|
nonprofit: 'Next Generation of Unity is a qualified 501(c)(3) nonprofit organization.',
|
||||||
|
taxId: '33-2819320',
|
||||||
|
email: 'info@nextgenerationofunity.org',
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ export const PAGE_LINKS = [
|
||||||
{ label: "Home", path: "/" },
|
{ label: "Home", path: "/" },
|
||||||
{ label: "Retreats", path: "/retreats" },
|
{ label: "Retreats", path: "/retreats" },
|
||||||
{ label: "Community", path: "/community" },
|
{ label: "Community", path: "/community" },
|
||||||
{ label: "Leadership", path: "/leadership" },
|
{ label: "Organization", path: "/organization" },
|
||||||
{ label: "Resources", path: "/resources" },
|
{ label: "Resources", path: "/resources" },
|
||||||
{ label: "History", path: "/history" },
|
{ label: "History", path: "/history" },
|
||||||
];
|
];
|
||||||
|
|
@ -31,11 +31,10 @@ export const PAGE_SECTIONS = {
|
||||||
{ label: "Unity Regions", hash: "#regions" },
|
{ label: "Unity Regions", hash: "#regions" },
|
||||||
{ label: "Partner Organizations", hash: "#partners" },
|
{ label: "Partner Organizations", hash: "#partners" },
|
||||||
],
|
],
|
||||||
"/leadership": [
|
"/organization": [
|
||||||
{ label: "Board & Staff", hash: "#board-staff" },
|
{ label: "Mission & Values", hash: "#mission" },
|
||||||
{ label: "Retreat Team", hash: "#retreat-team" },
|
{ label: "Leadership", hash: "#leadership" },
|
||||||
{ label: "Committees & Volunteers", hash: "#committees" },
|
{ label: "Details & Contact", hash: "#contact" },
|
||||||
{ label: "Contact Us", hash: "#contact" },
|
|
||||||
],
|
],
|
||||||
"/resources": [
|
"/resources": [
|
||||||
{ label: "Unity Teachings", hash: "#unity" },
|
{ label: "Unity Teachings", hash: "#unity" },
|
||||||
|
|
@ -49,7 +48,7 @@ export const PAGE_SECTIONS = {
|
||||||
|
|
||||||
// Right-side actions. `variant` picks the styling, not the destination.
|
// Right-side actions. `variant` picks the styling, not the destination.
|
||||||
export const NAV_ACTIONS = [
|
export const NAV_ACTIONS = [
|
||||||
{ label: "Contact Us", to: "/leadership#contact", variant: "ghost" },
|
{ label: "Contact Us", to: "/organization#contact", variant: "ghost" },
|
||||||
{
|
{
|
||||||
label: "Give",
|
label: "Give",
|
||||||
to: "/give",
|
to: "/give",
|
||||||
|
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
import PageShell from "../components/PageShell.tsx";
|
|
||||||
import ComingSoon from "../components/ComingSoon.tsx";
|
|
||||||
import { sitePage } from "../lib/site.ts";
|
|
||||||
import PeopleTiles from "../components/PeopleTiles.tsx";
|
|
||||||
import { ACCENTS, BRAND } from "../lib/color.ts"
|
|
||||||
|
|
||||||
/* Title and intro: site.json, which also gives the search metadata. */
|
|
||||||
const PAGE = sitePage("/leadership");
|
|
||||||
|
|
||||||
const SECTIONS = [
|
|
||||||
{
|
|
||||||
id: "board-staff",
|
|
||||||
title: "Board & Staff",
|
|
||||||
blurb: "The people guiding Next Generation of Unity day to day.",
|
|
||||||
accent: BRAND,
|
|
||||||
content: (
|
|
||||||
<div className="max-w-6xl mx-auto px-6">
|
|
||||||
<PeopleTiles size="lg" teams={{ id: "ngu-board",}} />
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "retreat-team",
|
|
||||||
title: "Retreat Team",
|
|
||||||
blurb: "Volunteers who plan and lead our gatherings throughout the year.",
|
|
||||||
accent: ACCENTS.green,
|
|
||||||
content: (
|
|
||||||
<div className="max-w-6xl mx-auto px-6">
|
|
||||||
<PeopleTiles size="lg" teams="ngu-retreat-team" />
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "committees",
|
|
||||||
title: "Committees & Volunteers",
|
|
||||||
blurb: "Additional roles and contributors.",
|
|
||||||
accent: ACCENTS.amber,
|
|
||||||
content: <ComingSoon what="this list of committees and volunteers" />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "contact",
|
|
||||||
title: "Contact Us",
|
|
||||||
blurb: "Reach out to our staff",
|
|
||||||
accent: ACCENTS.deep,
|
|
||||||
content: (
|
|
||||||
<div className="max-w-6xl mx-auto px-6">
|
|
||||||
<a
|
|
||||||
href="mailto:info@nextgenerationofunity.org"
|
|
||||||
className="inline-block py-2.5 px-6 btn border border-link text-link transition-all duration-200 hover:scale-105 active:scale-[0.98]"
|
|
||||||
>
|
|
||||||
info@nextgenerationofunity.org
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function Leadership() {
|
|
||||||
return (
|
|
||||||
<PageShell
|
|
||||||
title={PAGE.title}
|
|
||||||
intro={PAGE.description}
|
|
||||||
sections={SECTIONS}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
136
src/pages/Organization.tsx
Normal file
136
src/pages/Organization.tsx
Normal file
|
|
@ -0,0 +1,136 @@
|
||||||
|
/* ═══════════════════════════════════════════════════════════════
|
||||||
|
ORGANIZATION: /organization (it was /leadership, which the API
|
||||||
|
redirects here)
|
||||||
|
|
||||||
|
NGU itself, in three parts:
|
||||||
|
|
||||||
|
mission Mission, Vision & Values: the national organization
|
||||||
|
record's own description and content blocks (Data →
|
||||||
|
Organizations → NGU), so editors change them with the
|
||||||
|
block editor
|
||||||
|
leadership that record's teams, each with its people (OrgTeams):
|
||||||
|
the Board of Trustees, the Retreat Team, committees
|
||||||
|
and volunteers, in the admin's order
|
||||||
|
contact NGU's address, nonprofit status and email
|
||||||
|
(src/data/organizationDetails.ts), and the record's
|
||||||
|
own contact links (OrgContact)
|
||||||
|
|
||||||
|
The record is the one organization of kind national, found rather
|
||||||
|
than named, so its URL ID can change.
|
||||||
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
|
import PageShell from '../components/PageShell.tsx'
|
||||||
|
import ComingSoon from '../components/ComingSoon.tsx'
|
||||||
|
import ContentBlocks from '../components/ContentBlocks.tsx'
|
||||||
|
import OrgTeams, { hasTeams } from '../components/OrgTeams.tsx'
|
||||||
|
import OrgContact from '../components/OrgContact.tsx'
|
||||||
|
import { sitePage } from '../lib/site.ts'
|
||||||
|
import { useOrganizations } from '../lib/organizations.ts'
|
||||||
|
import { useOrganization, type OrganizationRecord } from '../lib/useContent.ts'
|
||||||
|
import { ORGANIZATION_DETAILS } from '../data/organizationDetails.ts'
|
||||||
|
import { ACCENTS, BRAND } from '../lib/color.ts'
|
||||||
|
|
||||||
|
/* Title and intro: site.json, which also gives the search metadata. */
|
||||||
|
const PAGE = sitePage('/organization')
|
||||||
|
|
||||||
|
export default function Organization() {
|
||||||
|
const national = useOrganizations('national')
|
||||||
|
const id = national.organizations[0]?.id
|
||||||
|
const record = useOrganization(id)
|
||||||
|
const org = record.data ?? null
|
||||||
|
const failed = national.error || record.error
|
||||||
|
const loading = !failed && !org && (national.loading || record.loading || Boolean(id))
|
||||||
|
|
||||||
|
const pending = (what: string) =>
|
||||||
|
failed ? (
|
||||||
|
<p className="mx-auto max-w-6xl px-6 text-danger">Couldn’t load {what} right now.</p>
|
||||||
|
) : loading ? (
|
||||||
|
<div className="mx-auto max-w-6xl px-6">
|
||||||
|
<div className="skeleton !min-h-40" aria-label={`Loading ${what}`} />
|
||||||
|
</div>
|
||||||
|
) : null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageShell
|
||||||
|
title={PAGE.title}
|
||||||
|
intro={PAGE.description}
|
||||||
|
sections={[
|
||||||
|
{
|
||||||
|
id: 'mission',
|
||||||
|
title: 'Mission, Vision & Values',
|
||||||
|
accent: BRAND,
|
||||||
|
content: pending('our mission') ?? <Mission org={org} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'leadership',
|
||||||
|
title: 'Leadership',
|
||||||
|
blurb: 'Our board, retreat team, committees and volunteers.',
|
||||||
|
accent: ACCENTS.green,
|
||||||
|
content:
|
||||||
|
pending('our leadership') ??
|
||||||
|
(org && hasTeams(org) ? (
|
||||||
|
<div className="mx-auto max-w-6xl px-6">
|
||||||
|
<OrgTeams org={org} accent={ACCENTS.green} />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<ComingSoon what="our leadership list" />
|
||||||
|
)),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'contact',
|
||||||
|
title: 'Details & Contact',
|
||||||
|
accent: ACCENTS.deep,
|
||||||
|
content: <Contact org={org} />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Mission({ org }: { org: OrganizationRecord | null }) {
|
||||||
|
const paragraphs = org?.description ?? []
|
||||||
|
const blocks = org?.blocks ?? []
|
||||||
|
if (paragraphs.length === 0 && blocks.length === 0) return <ComingSoon what="our mission, vision and values" />
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="mx-auto max-w-6xl space-y-6 px-6">
|
||||||
|
{paragraphs.map((paragraph, index) => (
|
||||||
|
<p key={index} className="max-w-3xl text-lg leading-relaxed text-body">
|
||||||
|
{paragraph}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
<div className="max-w-3xl">
|
||||||
|
<ContentBlocks blocks={blocks} accent={BRAND} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Contact({ org }: { org: OrganizationRecord | null }) {
|
||||||
|
const details = ORGANIZATION_DETAILS
|
||||||
|
return (
|
||||||
|
<div className="mx-auto grid max-w-6xl gap-8 px-6 md:grid-cols-2">
|
||||||
|
<div className="space-y-3 text-body">
|
||||||
|
<address className="not-italic leading-relaxed">
|
||||||
|
{details.street}
|
||||||
|
<br />
|
||||||
|
{details.cityLine}
|
||||||
|
<br />
|
||||||
|
<span className="text-sm text-muted">({details.addressNote})</span>
|
||||||
|
</address>
|
||||||
|
<p className="text-sm text-muted">
|
||||||
|
{details.nonprofit} Tax ID: {details.taxId}.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-4">
|
||||||
|
<a
|
||||||
|
href={`mailto:${details.email}`}
|
||||||
|
className="btn inline-block border border-link px-6 py-2.5 text-link transition-colors hover:bg-tint"
|
||||||
|
>
|
||||||
|
{details.email}
|
||||||
|
</a>
|
||||||
|
{org && <OrgContact org={org} accent={ACCENTS.deep} />}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -10,26 +10,23 @@
|
||||||
a region redirects to the canonical path rather than rendering a
|
a region redirects to the canonical path rather than rendering a
|
||||||
correct page at a wrong address.
|
correct page at a wrong address.
|
||||||
|
|
||||||
Leadership arrives flat with team_id and team_name on each row,
|
Its leadership, team by team, is OrgTeams (shared with the
|
||||||
so grouping costs nothing. `teams` is fetched alongside anyway:
|
Organization page); its contact buttons are OrgContact.
|
||||||
a team with no current public members would otherwise be
|
|
||||||
invisible here instead of listed, and its page unreachable.
|
|
||||||
═══════════════════════════════════════════════════════════════ */
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
import { Link, Navigate, useLocation, useParams } from 'react-router-dom'
|
import { Link, Navigate, useLocation, useParams } from 'react-router-dom'
|
||||||
|
|
||||||
import PageShell from '../components/PageShell.tsx'
|
import PageShell from '../components/PageShell.tsx'
|
||||||
import PageState from '../components/PageState.tsx'
|
import PageState from '../components/PageState.tsx'
|
||||||
import PlatformIcon from '../components/PlatformIcon.tsx'
|
|
||||||
import ContentBlocks from '../components/ContentBlocks.tsx'
|
import ContentBlocks from '../components/ContentBlocks.tsx'
|
||||||
import PeopleTiles from '../components/PeopleTiles.tsx'
|
import OrgTeams, { hasTeams } from '../components/OrgTeams.tsx'
|
||||||
|
import OrgContact from '../components/OrgContact.tsx'
|
||||||
import EventListCards from './sections/EventList-Cards.tsx'
|
import EventListCards from './sections/EventList-Cards.tsx'
|
||||||
import {
|
import {
|
||||||
useOrganization,
|
useOrganization,
|
||||||
type Leader,
|
|
||||||
type OrganizationRecord,
|
type OrganizationRecord,
|
||||||
} from '../lib/useContent.ts'
|
} from '../lib/useContent.ts'
|
||||||
import { orgHref, orgListHref, teamHref } from '../lib/hrefs.ts'
|
import { orgHref, orgListHref } from '../lib/hrefs.ts'
|
||||||
import { mediaUrl } from '../lib/media.ts'
|
import { mediaUrl } from '../lib/media.ts'
|
||||||
import { initialsFor } from '../lib/organizations.ts'
|
import { initialsFor } from '../lib/organizations.ts'
|
||||||
import Logo from '../components/Logo.tsx'
|
import Logo from '../components/Logo.tsx'
|
||||||
|
|
@ -94,69 +91,20 @@ export default function OrganizationDetail() {
|
||||||
<ContentBlocks blocks={org.blocks} accent={accent} />
|
<ContentBlocks blocks={org.blocks} accent={accent} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Contact org={org} accent={accent} />
|
<OrgContact org={org} accent={accent} />
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const teamBlocks = groupLeadership(org)
|
if (hasTeams(org)) {
|
||||||
|
|
||||||
if (teamBlocks.length > 0) {
|
|
||||||
sections.push({
|
sections.push({
|
||||||
id: 'leadership',
|
id: 'leadership',
|
||||||
title: 'Who runs it',
|
title: 'Who runs it',
|
||||||
accent,
|
accent,
|
||||||
content: (
|
content: (
|
||||||
<div className="max-w-6xl mx-auto px-6 space-y-12">
|
<div className="max-w-6xl mx-auto px-6">
|
||||||
{teamBlocks.map((block) => (
|
<OrgTeams org={org} accent={accent} />
|
||||||
<div key={block.key}>
|
|
||||||
<div className="mb-4">
|
|
||||||
{block.teamId ? (
|
|
||||||
<h3 className="text-xl font-bold">
|
|
||||||
<Link
|
|
||||||
to={teamHref(block.teamId)}
|
|
||||||
className="hover:underline"
|
|
||||||
style={{ color: accentText(accent) }}
|
|
||||||
>
|
|
||||||
{block.label}
|
|
||||||
</Link>
|
|
||||||
</h3>
|
|
||||||
) : (
|
|
||||||
block.label && (
|
|
||||||
<h3 className="text-xl font-bold" style={{ color: accentText(accent) }}>
|
|
||||||
{block.label}
|
|
||||||
</h3>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
{block.tagline && (
|
|
||||||
<p className="mt-1 text-sm" style={{ color: BODY }}>
|
|
||||||
{block.tagline}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{block.people.length > 0 ? (
|
|
||||||
<PeopleTiles
|
|
||||||
size="lg"
|
|
||||||
accent={block.accent || accent}
|
|
||||||
people={block.people.map((leader) => ({
|
|
||||||
id: leader.person_id,
|
|
||||||
name: leader.display_name,
|
|
||||||
title: leader.title,
|
|
||||||
pronouns: leader.pronouns,
|
|
||||||
public_email: leader.public_email,
|
|
||||||
photo: mediaUrl(leader.photo),
|
|
||||||
is_owner: leader.is_owner,
|
|
||||||
}))}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<p className="text-sm italic" style={{ color: BODY }}>
|
|
||||||
No members listed yet.
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|
@ -308,53 +256,6 @@ function Facts({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
|
|
||||||
const hasAny =
|
|
||||||
org.links.length > 0 || org.socials.length > 0 || org.website || org.email
|
|
||||||
|
|
||||||
if (!hasAny) return null
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="flex flex-wrap gap-3">
|
|
||||||
{org.links.map((link) => (
|
|
||||||
<a
|
|
||||||
key={link.url}
|
|
||||||
href={link.url}
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
className="inline-flex items-center gap-2 btn px-5 py-2 text-sm text-white transition-transform hover:scale-105"
|
|
||||||
style={{ background: accent }}
|
|
||||||
>
|
|
||||||
<PlatformIcon platform={link.platform} />
|
|
||||||
{link.label}
|
|
||||||
</a>
|
|
||||||
))}
|
|
||||||
|
|
||||||
{/* website and email arrive as bare strings (splitLinks in
|
|
||||||
shape.js); socials are whole link rows. */}
|
|
||||||
{[
|
|
||||||
org.website ? { url: org.website, label: 'Website', platform: null } : null,
|
|
||||||
org.email ? { url: `mailto:${org.email}`, label: org.email, platform: null } : null,
|
|
||||||
...org.socials,
|
|
||||||
]
|
|
||||||
.filter((link): link is NonNullable<typeof link> => Boolean(link))
|
|
||||||
.map((link) => (
|
|
||||||
<a
|
|
||||||
key={link.url}
|
|
||||||
href={link.url}
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
className="inline-flex items-center gap-2 btn border px-4 py-1.5 text-sm transition-colors hover:bg-tint"
|
|
||||||
style={{ borderColor: accent, color: accentText(accent) }}
|
|
||||||
>
|
|
||||||
<PlatformIcon platform={link.platform} />
|
|
||||||
{link.label}
|
|
||||||
</a>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function GroupMark({ file, name, accent }: { file?: string | null; name: string; accent: string }) {
|
function GroupMark({ file, name, accent }: { file?: string | null; name: string; accent: string }) {
|
||||||
return (
|
return (
|
||||||
<Logo
|
<Logo
|
||||||
|
|
@ -372,67 +273,3 @@ function GroupMark({ file, name, accent }: { file?: string | null; name: string;
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Leadership → team blocks ────────────────────────────────── */
|
|
||||||
|
|
||||||
type TeamBlock = {
|
|
||||||
key: string
|
|
||||||
teamId: string | null
|
|
||||||
label: string | null
|
|
||||||
tagline?: string | null
|
|
||||||
accent?: string | null
|
|
||||||
people: Leader[]
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Order comes from `teams` (the admin's sort_order), not from the
|
|
||||||
order people happen to appear in. Three cases to cover:
|
|
||||||
affiliations with no team at all, teams with nobody in them, and
|
|
||||||
people filed under a team that is no longer published. */
|
|
||||||
function groupLeadership(org: OrganizationRecord): TeamBlock[] {
|
|
||||||
const byTeam = new Map<string, Leader[]>()
|
|
||||||
const loose: Leader[] = []
|
|
||||||
|
|
||||||
for (const leader of org.leadership) {
|
|
||||||
if (!leader.team_id) {
|
|
||||||
loose.push(leader)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
const list = byTeam.get(leader.team_id)
|
|
||||||
if (list) list.push(leader)
|
|
||||||
else byTeam.set(leader.team_id, [leader])
|
|
||||||
}
|
|
||||||
|
|
||||||
const blocks: TeamBlock[] = []
|
|
||||||
|
|
||||||
// People who hold a role in the organization without sitting on a
|
|
||||||
// team. Usually the leads. No heading, they are the page.
|
|
||||||
if (loose.length > 0) {
|
|
||||||
blocks.push({ key: 'loose', teamId: null, label: null, people: loose })
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const team of org.teams) {
|
|
||||||
blocks.push({
|
|
||||||
key: team.id,
|
|
||||||
teamId: team.id,
|
|
||||||
label: team.name,
|
|
||||||
tagline: team.tagline,
|
|
||||||
accent: team.color,
|
|
||||||
people: byTeam.get(team.id) ?? [],
|
|
||||||
})
|
|
||||||
byTeam.delete(team.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Whatever is left is filed under an unpublished team. Its page
|
|
||||||
// isn't reachable, so the heading is plain text, but the people
|
|
||||||
// are real and shouldn't silently vanish from the org.
|
|
||||||
for (const [teamId, people] of byTeam) {
|
|
||||||
blocks.push({
|
|
||||||
key: teamId,
|
|
||||||
teamId: null,
|
|
||||||
label: people[0]?.team_name ?? null,
|
|
||||||
people,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return blocks
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ export default function PersonDetail() {
|
||||||
notFound={notFound}
|
notFound={notFound}
|
||||||
onRetry={reload}
|
onRetry={reload}
|
||||||
noun="person"
|
noun="person"
|
||||||
backTo="/leadership"
|
backTo="/organization"
|
||||||
backLabel="Leadership"
|
backLabel="Organization"
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +247,7 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
|
||||||
|
|
||||||
{person.location_label && <span style={{ color: BODY }}>{person.location_label}</span>}
|
{person.location_label && <span style={{ color: BODY }}>{person.location_label}</span>}
|
||||||
|
|
||||||
<Link to="/leadership" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
|
<Link to="/organization#leadership" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
|
||||||
Leadership
|
Leadership
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ export default function TeamDetail() {
|
||||||
notFound={notFound}
|
notFound={notFound}
|
||||||
onRetry={reload}
|
onRetry={reload}
|
||||||
noun="team"
|
noun="team"
|
||||||
backTo="/leadership"
|
backTo="/organization"
|
||||||
backLabel="Leadership"
|
backLabel="Organization"
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue