Leadership becomes the Organization page, at /organization

Three sections: Mission, Vision & Values from the national
organization record's own description and content blocks;
Leadership as that record's teams with their people; Details &
Contact with NGU's address, nonprofit status, email and the
record's contact links. /leadership answers with a 301 to
/organization (MOVED in routes/pages.js), and a page title or intro
saved for it in Site settings moves with it (migration 054).

OrganizationDetail's team list and contact buttons are now shared
components (OrgTeams, OrgContact), and NGU's address and email live
once in src/data/organizationDetails.ts for the footer, the page and
ComingSoon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-30 20:30:18 -05:00
parent 7c7cdaac14
commit 499662b59a
15 changed files with 400 additions and 268 deletions

View file

@ -7,7 +7,9 @@
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 }) {
return (

View file

@ -2,6 +2,7 @@ import { Link } from "react-router-dom";
import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
import siteLogo from "../assets/logos/NGU_Logo.svg";
import PlatformIcon from "./PlatformIcon.tsx";
import { ORGANIZATION_DETAILS as Organization_Details } from "../data/organizationDetails.ts";
const Social_Links = [
{ label: "Instagram", href: "https://www.instagram.com/nextgenerationunity/", platform: "instagram" },
@ -22,19 +23,9 @@ type TouchLink = { label: string } & (
const Get_In_Touch: TouchLink[] = [
{ label: "Feedback", to: "/feedback"},
{ 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 = [
{ label: "Privacy Policy", to: "/privacy" },
{ label: "Terms of Service", to: "/terms" },

View 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
View 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
}