Compare commits

...

6 commits

Author SHA1 Message Date
Zaldimmar
c0a5e3ceeb Bump SITE_VERSION to v1.9.0-audit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:14:10 -05:00
Zaldimmar
0b34e6cf9e Bring CLAUDE.md in line with the code
Correct the admin-crud and admin-schema paths, the logo note, where data
hooks live and the Node version; add the graphify section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:14:10 -05:00
Zaldimmar
185f9831e2 Fix accessibility found in the audit
- Text contrast: teal text and button fills use #0f7183 (5.7:1), section
  accents darkened to pass on white, solid CTA buttons instead of the
  gradient, footer and subnav text raised to white/65, event and region
  colours kept on borders and swatches with ink text
- Hidden carousel slides and collapsed past events are inert
- Admin list rows carry a real link for keyboard use
- Mobile menu is a modal dialog: focus, Escape, inert background, above
  the header
- Skip to content link, one focus-visible ring, reduced-motion rule,
  focus rings on the calendar inputs
- Region headings hold their button instead of sitting inside it
- font-700 style classes (not Tailwind v4 utilities) replaced with named
  weights, and the 700/800 font files loaded
- Migration 038: alt text for blog covers and schedule graphics; event
  logos next to their title are decorative
- Drop the Church Center script from index.html; Giving loads it itself

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:07:56 -05:00
Zaldimmar
5274e09571 Clean up code found in the audit
- Replace every em-dash in src and server/src with a colon, comma or hyphen
- Give every relative import its file extension (.jsx imports of .tsx fixed)
- Delete old-historyMock.ts, unused exports, unused CSS utilities, the
  unused @ alias and the fallback option nothing passed
- One copy each of initials, capitalize, byName and the server's marks()
- Move the organization, chapter and event hooks from src/data to src/lib
- Schema sync always throws on a mismatch (strict was never turned off)
- Replace the placeholder README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:02:03 -05:00
Zaldimmar
4066e9ec61 Harden security found in the audit
- Rate limits and IP hashes use the X-Forwarded-For entry nginx adds,
  not the client-supplied first one
- Link preview and feed fetches block IPv4-mapped and other embedded
  IPv6 forms of private addresses (net.BlockList)
- CSRF check on /api writes; security headers and HSTS on every response
- Viewers no longer receive a person's private details (readRole)
- Sessions end 90 days after sign-in however active
- yt-dlp ignores config files and takes the link after --
- Meta tag insert no longer expands $ patterns from record text
- Links with an unsafe scheme draw as text
- Migration 037: leadership lists name published home orgs only
- Ignore *.db-wal, *.db-shm and *.txt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:56:49 -05:00
Zaldimmar
693dd84b6e Fix bugs found in the audit
- People tiles resolve a bare photo filename to /uploads, via personPhoto
- api.ts keeps the Accept header when a request sets its own headers
- Feedback hashes IPs with auth.js's salt and client IP helper
- Drop the better-sqlite3 fallback (not installed); require Node 22.13+

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:53:46 -05:00
118 changed files with 764 additions and 997 deletions

9
.gitignore vendored
View file

@ -13,15 +13,22 @@ build/
# local databases
*.db
*.db-journal
*.db-wal
*.db-shm
# editor and OS files
.vscode/*
!.vscode/extensions.json
.DS_Store
Thumbs.db
nginx-dev
# plain txt files
.txt
*.txt
# uploaded media (local dev)
server/uploads/
server/clips/
# skills
graphify-out/

View file

@ -8,7 +8,7 @@ Website for NGU (Next Generation of Unity), a Unity movement organization with r
## Stack
- Frontend: React, TypeScript, Tailwind CSS, React Router, Vite (in `src/`)
- Backend: Hono on Node.js, SQLite (WAL mode, STRICT tables) via better-sqlite3 / node:sqlite (in `server/`)
- Backend: Hono on Node.js, SQLite (WAL mode, STRICT tables) via node:sqlite (in `server/`)
- Package manager: pnpm only (never npm or yarn)
## Commands
@ -18,7 +18,7 @@ Frontend (repo root):
- `pnpm exec tsc`: type-check (`noEmit`; there is no separate lint or typecheck script)
- There is no test suite.
Backend (`server/`, Node >= 22). The server reads `HOST` (default `127.0.0.1`), `PORT` (default `3001`), `DB_PATH` (default `./ngu.db`) and `UPLOADS_DIR` (default `./uploads`); locally, use `DB_PATH=./dev.db`:
Backend (`server/`, Node >= 22.13). The server reads `HOST` (default `127.0.0.1`), `PORT` (default `3001`), `DB_PATH` (default `./ngu.db`) and `UPLOADS_DIR` (default `./uploads`); locally, use `DB_PATH=./dev.db`:
- `DB_PATH=./dev.db pnpm dev`: run with `node --watch`
- `DB_PATH=./dev.db pnpm migrate`: apply migrations without starting the server
- `DB_PATH=./dev.db node src/admin-cli.js add|list|passwd|role|disable|enable ...`: the only way accounts are created
@ -54,11 +54,11 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu
## Project layout
- All pages use `PageShell.tsx` as the wrapper unless explicitly noted otherwise.
- Pages live in `src/pages/`; section-level components go in `src/pages/sections/`.
- `src/data/` holds only hardcoded data shared across multiple section files (e.g. `historyDecades.ts`, map grid). Everything else comes from SQLite.
- `src/data/` holds only hardcoded data shared across multiple section files (e.g. `historyDecades.ts`, map grid). Everything else comes from SQLite, through hooks in `src/lib/`.
- `navConfig.ts` is the single source of truth for navigation, routes, and actions (header, footer, pages).
- `api.ts` is the shared caching client used by frontend data hooks.
- `docs/updating-data-in-code.md`: where content that isn't in the database lives (admin dropdown labels, fixed value lists, nav, banner, decades, map grid) and how to change it. Keep it current when adding a dropdown or code-owned content.
- Images: every record image (logos, photos, backgrounds, block images) is an upload. A bare filename resolves to `/uploads/<file>` (`src/lib/media.ts`, and `server/src/pageMeta.js` for previews). Only the site's own chosen assets, the NGU logos in the nav, footer and admin, are bundled from `src/assets/logos/`. The `<Logo>` component hides itself on load error.
- Images: every record image (logos, photos, backgrounds, block images) is an upload. A bare filename resolves to `/uploads/<file>` (`src/lib/media.ts`, and `server/src/pageMeta.js` for previews). Only the site's own chosen assets, the NGU logos in the nav, footer and admin, are bundled from `src/assets/logos/`. Logo images hide themselves on load error (`onError`).
## Rules and gotchas
- **Role checks must use ladder comparisons, never equality.** Roles rank viewer → editor → admin → superadmin. Use the minimum-rank helpers from `src/lib/roles.ts` (`canWrite`, `canDelete`, `isSuper`, `atLeast`). Where a local variable shadows the name, import with an alias, e.g. `canWrite as roleCanWrite`. `role === "admin"` silently excludes higher roles and has caused repeated bugs.
@ -69,7 +69,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu
- **Admin editor text:** blank select options read `Default: …` (what blank means), examples in help text start with `eg.`, and record ids are called "URL ID". Cut-off preview text uses `preview()` from `src/lib/text.ts`, which ends it with an ellipsis. See `docs/updating-data-in-code.md`.
## Admin CRUD engine
Descriptor-driven: `server/admin-crud.js` and `admin-schema.js` (server) and `adminSchema.ts` (client) generate SQL and form fields from declarative entity configs. Adding an entity should mean adding a descriptor, not new CRUD code.
Descriptor-driven: `server/src/admin-crud.js` and `server/src/admin-schema.js` (server) and `adminSchema.ts` (client) generate SQL and form fields from declarative entity configs. Adding an entity should mean adding a descriptor, not new CRUD code.
- Child collections are deleted and reinserted wholesale. Unsafe for entities referenced by foreign keys elsewhere.
- `reindex: false` prevents cross-entity sort order collisions.
- The `OMIT` sentinel distinguishes unsent fields from deliberate clears.
@ -83,4 +83,14 @@ Descriptor-driven: `server/admin-crud.js` and `admin-schema.js` (server) and `ad
- The runner turns foreign keys off around every migration (it can't be done inside the file's transaction) and runs `PRAGMA foreign_key_check` before committing, so a table rebuild needs no `PRAGMA foreign_keys` of its own. When views or triggers name the table being rebuilt, wrap the drop-and-rename in `PRAGMA legacy_alter_table = ON` ... `OFF`, then recreate the rebuilt table's own indexes and triggers.
## Integrations
- Church Center (ngu.churchcenteronline.com): Planning Center embeds for giving and the calendar.
- Church Center (ngu.churchcenteronline.com): Planning Center embeds for giving.
## graphify
This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships.
Rules:
- For codebase questions, first run `graphify query "<question>"` when graphify-out/graph.json exists. Use `graphify path "<A>" "<B>"` for relationships and `graphify explain "<concept>"` for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output.
- If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
- After modifying code, run `graphify update .` to keep the graph current (AST-only, no API cost).

View file

@ -1 +1,8 @@
Test line added by Claude Code.
# NGU-Web
Website for NGU (Next Generation of Unity): a public site and a role-based admin panel.
- Frontend: React, TypeScript, Tailwind, Vite (`src/`). `pnpm dev`, `pnpm build`.
- API: Hono on Node 22.13+, SQLite (`server/`). `DB_PATH=./dev.db pnpm dev`.
- Accounts are made with `server/src/admin-cli.js`.
- Deployment and setup notes are in `docs/`; working notes for contributors are in `CLAUDE.md`.

View file

@ -5,7 +5,6 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><!-- site:title --></title>
<script src="https://js.churchcenter.com/modal/v1"></script>
<!-- site:head-end -->
</head>
<body>

View file

@ -4,7 +4,7 @@
"private": true,
"type": "module",
"engines": {
"node": ">=22"
"node": ">=22.13"
},
"scripts": {
"dev": "node --watch src/index.js",

View file

@ -28,7 +28,7 @@
The list comes from auth.js rather than being repeated here, so
the CLI can't drift from what requireRole will actually accept.
This is also how the first superadmin is made — there's no
This is also how the first superadmin is made, there's no
bootstrap path in the web interface, on purpose:
node src/admin-cli.js role you@ngu.org superadmin
@ -82,7 +82,7 @@ async function readPassword() {
if (first === "") {
const generated = randomBytes(12).toString("base64url");
console.log(`\nGenerated password: ${generated}`);
console.log("Copy it now — it isn't stored anywhere readable.\n");
console.log("Copy it now, it isn't stored anywhere readable.\n");
return generated;
}
@ -116,7 +116,7 @@ function checkRole(role) {
return role;
}
/* Printed, never enforced — see the note at the top of the file.
/* Printed, never enforced, see the note at the top of the file.
Worth saying out loud, because the person doing it is usually
tidying up accounts rather than thinking about lockouts. */
function warnIfLastSuper(db, user) {
@ -183,7 +183,7 @@ function setRole(db, email, role) {
db.prepare("UPDATE admin_users SET role = ? WHERE id = ?").run(role, user.id);
// The session they're holding was issued against the old role.
// Every check reads the row fresh, so it isn't a security hole —
// Every check reads the row fresh, so it isn't a security hole,
// but their open tab would keep drawing buttons that now 403.
destroyAllSessionsFor(db, user.id);

View file

@ -304,7 +304,7 @@ export function createRow(db, entity, payload) {
)
.run(...Object.values(values))
: db.prepare(`INSERT INTO ${entity.table} DEFAULT VALUES`).run();
// better-sqlite3 and node:sqlite disagree about BigInt here.
// node:sqlite may hand back a BigInt here.
newId = Number(result.lastInsertRowid);
} else {
const names = [entity.idColumn, ...Object.keys(values)];

View file

@ -18,7 +18,7 @@
ever set it, so every insert through the admin will fail.
The first is a silent repair. The other two are deployment bugs,
so with { strict: true } they stop the service starting rather
so they stop the service starting rather
than waiting to surface one row at a time.
═══════════════════════════════════════════════════════════════ */
@ -84,7 +84,7 @@ function collectGroups(entity) {
return groups;
}
export function syncDescriptorsWithSchema(db, entities, { strict = true } = {}) {
export function syncDescriptorsWithSchema(db, entities) {
const list = Array.isArray(entities) ? entities.map((e) => [e.name ?? e.table, e]) : Object.entries(entities);
const inferred = [];
@ -136,8 +136,7 @@ export function syncDescriptorsWithSchema(db, entities, { strict = true } = {})
if (problems.length) {
const report = `[admin-schema] descriptor does not match the database:\n ${problems.join("\n ")}`;
if (strict) throw new Error(report);
console.error(report);
throw new Error(report);
}
return { inferred, problems };

View file

@ -206,6 +206,7 @@ const blocksChild = (ownerKind) => ({
text("person_id"),
text("description"),
text("media"),
text("media_alt"),
text("map"),
],
},
@ -478,6 +479,7 @@ const people = {
key: "private",
table: "person_private",
idColumn: "person_id",
readRole: "editor", // viewers don't see birth dates, addresses, phones
touch: true, // has its own updated_at with no trigger behind it
columns: [
date("birth_date"),
@ -839,6 +841,7 @@ const blogPosts = {
text("title", { required: true }),
text("excerpt"),
text("cover_image"),
text("cover_alt"),
date("published_on"),
text("tags"),
text("guest_author"),

View file

@ -29,6 +29,8 @@ const SESSION_DAYS = 30;
// Re-issue the expiry when a session is used with less than this
// left, so an active person is never signed out mid-task.
const REFRESH_WITHIN_DAYS = 7;
// However active, a session ends this long after sign-in.
const MAX_SESSION_DAYS = 90;
// Off only for plain-http local work. Production is behind TLS.
export const SECURE_COOKIE = (process.env.COOKIE_SECURE ?? "true") !== "false";
@ -95,9 +97,11 @@ export function hashIp(ip) {
}
export function clientIp(c) {
// Trustworthy only because this service binds to 127.0.0.1 and
// nginx is the only thing that can reach it.
return c.req.header("x-forwarded-for")?.split(",")[0].trim() ?? null;
// The last X-Forwarded-For entry is the one nginx (or Vite in dev)
// added from the connection itself; anything before it is whatever
// the client sent. Trustworthy only because this service binds to
// 127.0.0.1 and nginx is the only thing that can reach it.
return c.req.header("x-forwarded-for")?.split(",").at(-1).trim() || null;
}
/* ── Sessions ────────────────────────────────────────────────── */
@ -160,9 +164,10 @@ export function currentUser(db, c) {
JOIN admin_users u ON u.id = s.user_id
WHERE s.token_hash = ?
AND s.expires_at > datetime('now')
AND s.created_at > datetime('now', ?)
AND u.is_active = 1`,
)
.get(tokenHash);
.get(tokenHash, `-${MAX_SESSION_DAYS} days`);
if (!row) return null;

View file

@ -291,8 +291,9 @@ async function download(db, job) {
await run(
YTDLP,
[
// Our options only: no yt-dlp.conf on the box changes them.
"--ignore-config",
...cookies.args,
job.source_url,
// YouTube needs a JavaScript runtime to list formats; the one
// running this server will do.
"--js-runtimes",
@ -319,6 +320,9 @@ async function download(db, job) {
...(process.env.FFMPEG_PATH ? ["--ffmpeg-location", process.env.FFMPEG_PATH] : []),
"-o",
template,
// Last, after --, so the link can never be read as an option.
"--",
job.source_url,
],
{
onLine: (line) => {

View file

@ -2,15 +2,12 @@
DATABASE
One SQLite file, opened once at boot and held for the life of
the process. Node's own sqlite module is used when it's there
(Node 24+), better-sqlite3 otherwise. Their APIs overlap enough
that everything below works against either, as long as you:
the process, through Node's own node:sqlite (Node 22.13+).
House rules:
• use positional ? parameters, never named ones
• pass 0/1 for booleans, never true/false
• use tx() rather than db.transaction()
Those three rules are the whole compatibility story.
• use tx(): node:sqlite has no db.transaction()
═══════════════════════════════════════════════════════════════ */
import { readdirSync, readFileSync } from "node:fs";
@ -20,18 +17,6 @@ import { fileURLToPath } from "node:url";
const HERE = dirname(fileURLToPath(import.meta.url));
const MIGRATIONS_DIR = join(HERE, "migrations");
/* ── Driver selection ──────────────────────────────────────── */
async function loadDriver() {
try {
const { DatabaseSync } = await import("node:sqlite");
return { Driver: DatabaseSync, name: "node:sqlite" };
} catch {
const { default: BetterSqlite3 } = await import("better-sqlite3");
return { Driver: BetterSqlite3, name: "better-sqlite3" };
}
}
/* ── Open ──────────────────────────────────────────────────────
WAL readers never block the writer, which matters the
moment a feedback POST lands mid page-load
@ -42,15 +27,15 @@ async function loadDriver() {
───────────────────────────────────────────────────────────── */
export async function openDatabase(path) {
const { Driver, name } = await loadDriver();
const db = new Driver(path);
const { DatabaseSync } = await import("node:sqlite");
const db = new DatabaseSync(path);
db.exec("PRAGMA journal_mode = WAL");
db.exec("PRAGMA foreign_keys = ON");
db.exec("PRAGMA synchronous = NORMAL");
db.exec("PRAGMA busy_timeout = 5000");
db.driverName = name;
db.driverName = "node:sqlite";
return db;
}

View file

@ -3,7 +3,7 @@
Binds to localhost only. nginx is the only thing that talks to
it, which is what lets the routes trust X-Forwarded-For and skip
CORS entirely — in production the API and the site share an
CORS entirely, in production the API and the site share an
origin, and in development Vite proxies /api so they share one
there too.
═══════════════════════════════════════════════════════════════ */
@ -13,7 +13,9 @@ import { mkdir } from "node:fs/promises";
import { serve } from "@hono/node-server";
import { serveStatic } from "@hono/node-server/serve-static";
import { Hono } from "hono";
import { csrf } from "hono/csrf";
import { logger } from "hono/logger";
import { secureHeaders } from "hono/secure-headers";
import { openDatabase, migrate } from "./db.js";
import { rateLimit } from "./rateLimit.js";
@ -57,6 +59,39 @@ const app = new Hono();
app.use("*", logger());
/* Headers for every response. Referrer kept to the origin (YouTube
embeds refuse to play without one); HSTS without includeSubDomains
so a plain-http dev subdomain keeps working. No CSP yet: pages carry
an inline window.__NGU_SITE__ script and YouTube, Facebook and Maps
iframes, so one needs trying in Report-Only first. */
app.use(
"*",
secureHeaders({
referrerPolicy: "strict-origin-when-cross-origin",
strictTransportSecurity: "max-age=31536000",
}),
);
/* Refuse a form-style write (text/plain, form or multipart body)
that another site sent, including a sibling subdomain, which
SameSite=Lax cookies don't stop. Browsers mark their own requests
Sec-Fetch-Site: same-origin; older ones fall back to Origin, judged
by host because nginx speaks plain http to this service. JSON
bodies can't be sent cross-origin without a CORS preflight, which
this API never answers. */
app.use(
"/api/*",
csrf({
origin: (origin, c) => {
try {
return new URL(origin).host === c.req.header("host");
} catch {
return false;
}
},
}),
);
app.use("*", async (c, next) => {
c.set("db", db);
await next();
@ -139,7 +174,7 @@ const server = serve({ fetch: app.fetch, hostname: HOST, port: PORT }, (info) =>
for (const signal of ["SIGTERM", "SIGINT"]) {
process.on(signal, () => {
console.log(`${signal} — shutting down`);
console.log(`${signal}, shutting down`);
server.close(() => {
try {
db.close();

View file

@ -40,35 +40,24 @@ const USER_AGENT = "NGU-LinkPreview/1.0 (+https://nextgenerationofunity.org)";
/* ── Address checks ────────────────────────────────────────── */
function ipv4Blocked(ip) {
const [a, b] = ip.split(".").map(Number);
return (
a === 0 ||
a === 10 ||
a === 127 ||
(a === 100 && b >= 64 && b <= 127) ||
(a === 169 && b === 254) ||
(a === 172 && b >= 16 && b <= 31) ||
(a === 192 && b === 168) ||
(a === 192 && b === 0) ||
(a === 198 && (b === 18 || b === 19)) ||
a >= 224
);
}
/* Private, loopback, link-local, shared, benchmark, multicast and
reserved ranges. BlockList also judges an IPv4-mapped IPv6 address
(::ffff:7f00:1, however it's written) by the IPv4 inside it. The
IPv6 ranges that embed an IPv4 some other way (NAT64, 6to4, the
old compatible form) are refused outright. */
const BLOCKED = new net.BlockList();
for (const [ip, bits] of [
["0.0.0.0", 8], ["10.0.0.0", 8], ["100.64.0.0", 10], ["127.0.0.0", 8],
["169.254.0.0", 16], ["172.16.0.0", 12], ["192.0.0.0", 24], ["192.168.0.0", 16],
["198.18.0.0", 15], ["224.0.0.0", 3],
]) BLOCKED.addSubnet(ip, bits, "ipv4");
for (const [ip, bits] of [
["::", 96], ["::1", 128], ["64:ff9b::", 96], ["64:ff9b:1::", 48], ["2002::", 16],
["fc00::", 7], ["fe80::", 10], ["ff00::", 8],
]) BLOCKED.addSubnet(ip, bits, "ipv6");
function ipBlocked(ip) {
if (net.isIPv4(ip)) return ipv4Blocked(ip);
const lower = ip.toLowerCase();
// An IPv4 address written as IPv6 is judged as the IPv4 it is.
const mapped = lower.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/);
if (mapped) return ipv4Blocked(mapped[1]);
return (
lower === "::" ||
lower === "::1" ||
/^f[cd]/.test(lower) || // fc00::/7 unique local
/^fe[89ab]/.test(lower) || // fe80::/10 link-local
/^ff/.test(lower) // multicast
);
return BLOCKED.check(ip, net.isIPv4(ip) ? "ipv4" : "ipv6");
}
async function vet(raw) {

View file

@ -180,7 +180,7 @@ CREATE TABLE event_scopes (
-- an every-other-week series is "on", which day
-- of the month a monthly one keeps, and the
-- weekday used when none is ticked
-- ends_on when set, the last day it can meet — which
-- ends_on when set, the last day it can meet, which
-- also keeps effective_status right
-- series_count when set, stops it after that many meetings,
-- whichever comes first
@ -297,7 +297,7 @@ CREATE UNIQUE INDEX event_hosts_person_uniq
--
-- Public by design. Everything in this table can appear on a card,
-- and is_published = 0 is the only thing between a row and the open
-- web — hence the default of 0, unlike organizations. Anything that
-- web, hence the default of 0, unlike organizations. Anything that
-- must never be served lives in person_private, so a careless
-- SELECT * can't leak it. Bios and pages go in content_blocks,
-- socials in links. People sort by sort_name; there is no
@ -306,7 +306,7 @@ CREATE UNIQUE INDEX event_hosts_person_uniq
CREATE TABLE people (
id TEXT PRIMARY KEY, -- slug: 'jane-doe'
display_name TEXT NOT NULL, -- 'Jane Doe'
sort_name TEXT, -- 'Doe, Jane' — list ordering
sort_name TEXT, -- 'Doe, Jane', list ordering
pronouns TEXT, -- 'she/her'
tagline TEXT, -- fallback when no title applies
photo TEXT, -- filename in public/people/
@ -346,7 +346,7 @@ CREATE TABLE person_private (
-- A team belongs to exactly one organization: NGU national has a
-- Board and a Leadership Team, a region or chapter can have its own.
-- UNIQUE (id, org_id) looks redundant against the primary key, and
-- is — except that it gives affiliations a composite foreign key to
-- is, except that it gives affiliations a composite foreign key to
-- point at, which stops someone filing a person under a team
-- belonging to a different organization.
CREATE TABLE teams (
@ -548,7 +548,7 @@ CREATE TABLE timeline_entries (
-- Null inherits from the referenced row: an event's starts_on. A
-- hand-authored entry has to supply its own, which the descriptor
-- can't require conditionally — the read layer reports an entry
-- can't require conditionally, the read layer reports an entry
-- with neither rather than the table refusing it.
occurred_on TEXT,
@ -604,9 +604,9 @@ CREATE INDEX timeline_entry_people_person_idx
-- FRONT PAGE
-- ═══════════════════════════════════════════════════════════════
--
-- The home page's editable half. One row in front_page — the CHECK
-- The home page's editable half. One row in front_page, the CHECK
-- on id makes a second one impossible, and the admin engine treats
-- it as a singleton — and ordered collections hanging off it, each
-- it as a singleton, and ordered collections hanging off it, each
-- replaced wholesale on save. Nothing has a foreign key into them,
-- which is what makes that safe.
--
@ -759,7 +759,7 @@ CREATE TABLE admin_users (
-- password at all. A row with both can use either route in.
password_hash TEXT,
-- Google's stable subject id. Nullable, unique when present —
-- Google's stable subject id. Nullable, unique when present,
-- SQLite allows any number of NULLs in a unique index.
google_sub TEXT UNIQUE,
@ -935,7 +935,7 @@ SELECT
tm.name AS team_name,
-- Whether the referenced record is itself visible. An entry must not
-- outlive the thing it points at being unpublished — a draft event
-- outlive the thing it points at being unpublished, a draft event
-- would otherwise leak its title and date onto a public page. Null
-- for a standalone milestone, which answers to nothing but its own
-- is_published.
@ -964,7 +964,7 @@ LEFT JOIN person_awards pa ON t.ref_kind = 'award' AND pa.award_id = t.re
-- ═══════════════════════════════════════════════════════════════
--
-- What a new database needs before anyone signs in: the scopes an
-- event can be filed under, and the front page as it ships — every
-- event can be filed under, and the front page as it ships, every
-- section, the stats that need no typing, and the Church Center
-- forms sorted into paths. Everything else comes in through the
-- admin.

View file

@ -0,0 +1,39 @@
-- ═══════════════════════════════════════════════════════════════
-- 037 LEADERSHIP VIEW: PUBLISHED HOME ORGS ONLY
--
-- v_org_leadership named a person's primary organization even when
-- that organization was unpublished, so a draft org's name could
-- show on a public leadership list. It now joins published ones
-- only; an unpublished one reads as no primary org.
-- ═══════════════════════════════════════════════════════════════
DROP VIEW v_org_leadership;
CREATE VIEW v_org_leadership AS
SELECT
a.org_id,
a.team_id,
t.name AS team_name,
t.sort_order AS team_sort_order,
a.person_id,
a.title,
a.role,
a.is_owner,
a.sort_order,
p.display_name,
p.sort_name,
p.pronouns,
p.tagline,
p.photo,
p.public_email,
p.location_label,
p.bio,
o.id AS primary_org_id,
o.name AS primary_org_name
FROM affiliations a
JOIN people p ON p.id = a.person_id AND p.is_published = 1
LEFT JOIN teams t ON t.id = a.team_id
LEFT JOIN organizations o ON o.id = p.primary_org_id AND o.is_published = 1
WHERE a.is_public = 1
AND a.ended_on IS NULL
ORDER BY a.org_id, a.is_owner DESC, a.sort_order, p.sort_name;

View file

@ -0,0 +1,13 @@
-- ═══════════════════════════════════════════════════════════════
-- 038 ALT TEXT FOR BLOG COVERS AND SCHEDULE GRAPHICS
--
-- Both images can carry information (a flyer, a site map, a cover
-- photo that sets the scene), so each gets its own description for
-- screen readers. Blank means decorative: the image is skipped.
--
-- blog_posts.cover_alt the cover image's description
-- content_block_items.media_alt a schedule entry graphic's
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE blog_posts ADD COLUMN cover_alt TEXT;
ALTER TABLE content_block_items ADD COLUMN media_alt TEXT;

View file

@ -450,7 +450,8 @@ export function renderPage(html, meta) {
tags.splice(2, 0, `<meta name="robots" content="noindex, nofollow">`);
}
return out.replace(/<\/head>/i, ` ${tags.join("\n ")}\n </head>`);
// A function, so a $& or $` in record text isn't read as a pattern.
return out.replace(/<\/head>/i, () => ` ${tags.join("\n ")}\n </head>`);
}
/* ── Sitemap ───────────────────────────────────────────────── */

View file

@ -5,11 +5,13 @@
the service restarts and it doesn't survive a second instance,
both of which are fine for one systemd unit on one box.
The client IP comes from X-Forwarded-For, which nginx sets. That
header is only trustworthy because nothing but nginx can reach
this port — it binds to 127.0.0.1. Don't expose the port.
The client IP comes from clientIp() in auth.js (the entry nginx
adds to X-Forwarded-For). That is only trustworthy because
nothing but nginx can reach this port, it binds to 127.0.0.1. Don't expose the port.
═══════════════════════════════════════════════════════════════ */
import { clientIp } from "./auth.js";
export function rateLimit({ windowMs = 60_000, max = 10 } = {}) {
const hits = new Map(); // ip → { count, resetAt }
@ -22,8 +24,7 @@ export function rateLimit({ windowMs = 60_000, max = 10 } = {}) {
}, windowMs).unref();
return async (c, next) => {
const ip =
c.req.header("x-forwarded-for")?.split(",")[0].trim() ?? "unknown";
const ip = clientIp(c) ?? "unknown";
const now = Date.now();
let entry = hits.get(ip);

View file

@ -52,6 +52,16 @@ function entityForWrite(c) {
return entity;
}
/* An extension can ask for more than a sign-in to be read
(readRole): a person's private details need editor. Blanked on
every row sent back, so a write's reply can't leak it either. */
function visible(c, entity, row) {
for (const ext of entity.extensions ?? []) {
if (ext.readRole && !hasRole(c.get("user"), ext.readRole)) row[ext.key] = null;
}
return row;
}
/* Everything the select inputs need, in one request. Small enough
that paging it would cost more than it saves. */
entities.get("/options", (c) => {
@ -71,12 +81,12 @@ entities.get("/:entity", (c) => {
entities.get("/:entity/:id", (c) => {
const entity = entityOr404(c);
return c.json({ row: readRow(c.get("db"), entity, c.req.param("id")) }, 200, NO_STORE);
return c.json({ row: visible(c, entity, readRow(c.get("db"), entity, c.req.param("id"))) }, 200, NO_STORE);
});
entities.post("/:entity", requireRole("editor"), async (c) => {
const entity = entityForWrite(c);
const row = createRow(c.get("db"), entity, await json(c));
const row = visible(c, entity, createRow(c.get("db"), entity, await json(c)));
console.log(`${entity.key} ${row[entity.idColumn]} created by ${c.get("user").email}`);
return c.json({ row }, 201, NO_STORE);
});
@ -84,7 +94,7 @@ entities.post("/:entity", requireRole("editor"), async (c) => {
entities.patch("/:entity/:id", requireRole("editor"), async (c) => {
const entity = entityForWrite(c);
const id = c.req.param("id");
const row = updateRow(c.get("db"), entity, id, await json(c));
const row = visible(c, entity, updateRow(c.get("db"), entity, id, await json(c)));
console.log(`${entity.key} ${id} updated by ${c.get("user").email}`);
return c.json({ row }, 200, NO_STORE);
});

View file

@ -24,7 +24,7 @@
import { Hono } from "hono";
import { asBool, loadBlocks, loadFeaturedCards, paragraphs } from "../shape.js";
import { asBool, loadBlocks, marks, loadFeaturedCards, paragraphs } from "../shape.js";
import { readFeeds } from "../feeds.js";
const blog = new Hono();
@ -33,7 +33,6 @@ const CACHE = "public, max-age=60, stale-while-revalidate=300";
const json = (c, body) => c.json(body, 200, { "Cache-Control": CACHE });
const marks = (n) => Array(n).fill("?").join(",");
const PAGE_ID = "community";
@ -104,6 +103,7 @@ blog.get("/blog/:id", (c) => {
title: row.title,
excerpt: row.excerpt,
cover_image: row.cover_image,
cover_alt: row.cover_alt,
published_on: row.published_on,
tags: splitTags(row.tags),
authors,

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
CONTENT ROUTES — read-only, mounted under /api
CONTENT ROUTES: read-only, mounted under /api
GET /events list + the event scopes
GET /events/:id one event, full body, people
@ -12,7 +12,7 @@
Organizations are one table, so they're one endpoint. A region
and a chapter differ by a handful of fields, which arrive under
`details` rather than as separate routes — that's what lets a
`details` rather than as separate routes, that's what lets a
list component be written once and pointed at any kind.
The lists leave out unlisted records (is_listed = 0); the
@ -32,7 +32,7 @@
every event.
An event's hosts are a list, in billing order, and each one is
either an organization or a person — `kind` says which, and
either an organization or a person, `kind` says which, and
`org_kind` is there for the three organization routes. The
first is the one the colour and logo fell back to, which is why
order is data and not a display choice.
@ -56,6 +56,7 @@ import {
asBool,
loadBlocks,
loadLinks,
marks,
paragraphs,
shapeSeries,
splitLinks,
@ -72,7 +73,6 @@ const json = (c, body) => c.json(body, 200, { "Cache-Control": CACHE });
const ORG_KINDS = ["national", "region", "chapter", "partner"];
const marks = (n) => Array(n).fill("?").join(",");
/* ── Loaders ───────────────────────────────────────────────── */
@ -83,7 +83,7 @@ const marks = (n) => Array(n).fill("?").join(",");
Unpublished hosts are dropped here rather than in the view: the
admin reads the same view and needs to see them. An event whose
only host is unpublished comes back with an empty list, which is
the right answer — there is nobody to name and nowhere to link. */
the right answer, there is nobody to name and nowhere to link. */
function loadHosts(db, ids) {
const byEvent = new Map();
if (ids.length === 0) return byEvent;
@ -230,8 +230,8 @@ function shapeTeam(row, links, cardBlocks) {
};
}
/* awards.org_id is nullable — an award can predate any decision
about which organization owns it — so `org` genuinely can be
/* awards.org_id is nullable, an award can predate any decision
about which organization owns it, so `org` genuinely can be
null, and is also null when the awarding org is unpublished. */
function shapeAward(row) {
return {
@ -372,7 +372,7 @@ function attachLeadership(db, orgs) {
/* Every team this organization has, including ones with nobody
currently filed under them. `leadership` already carries team_id
and team_name, so the page can group people without this — but
and team_name, so the page can group people without this, but
grouping alone would make an empty team invisible rather than
listed, which is the wrong answer for a team that exists. */
function attachTeams(db, orgs) {

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
FEEDBACK ROUTE — the only public write on the site
FEEDBACK ROUTE: the only public write on the site
Everything hostile that will ever reach this service arrives
here, so the defences live here rather than being sprinkled
@ -10,13 +10,12 @@
length caps rejected before anything touches the database
no HTML stored verbatim, escaped at render time
The write is a single INSERT with positional parameters, so it
works on node:sqlite and better-sqlite3 alike. No transaction:
one statement is already atomic.
The write is a single INSERT. No transaction: one statement is
already atomic.
═══════════════════════════════════════════════════════════════ */
import { Hono } from "hono";
import { createHash, randomBytes } from "node:crypto";
import { clientIp, hashIp } from "../auth.js";
const feedback = new Hono();
@ -31,29 +30,10 @@ const LIMITS = {
const MIN_MESSAGE = 10;
// Must match FEEDBACK_TYPES in src/pages/sections/FeedbackForm.jsx.
// 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.
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other"];
/* ── IP hashing ────────────────────────────────────────────────
Stored so repeat abuse from one source is visible during
triage, hashed so the table never holds an address. Without
IP_SALT the salt is regenerated each boot, which makes hashes
incomparable across restarts — fine for dev, set it in
/etc/ngu/api.env for production.
───────────────────────────────────────────────────────────── */
const IP_SALT = process.env.IP_SALT ?? randomBytes(16).toString("hex");
if (!process.env.IP_SALT) {
console.warn("IP_SALT unset — feedback ip_hash values reset on restart");
}
function hashIp(ip) {
if (!ip) return null;
return createHash("sha256").update(`${IP_SALT}:${ip}`).digest("hex").slice(0, 32);
}
/* ── Input cleaning ──────────────────────────────────────────── */
function clean(value, max) {
@ -118,7 +98,7 @@ feedback.post("/", async (c) => {
pagePath || null,
sectionId || null,
clean(c.req.header("user-agent"), 500) || null,
hashIp(c.req.header("x-forwarded-for")?.split(",")[0].trim()),
hashIp(clientIp(c)),
);
// created_at and status come from column defaults.

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
HISTORY ROUTE — read-only, mounted under /api
HISTORY ROUTE: read-only, mounted under /api
GET /history every published timeline entry
@ -17,7 +17,7 @@
queries doesn't grow with the number of entries.
· precision that outruns the date. An entry can hold '2012' with
precision 'day' — the admin doesn't stop you. Trusting that
precision 'day', the admin doesn't stop you. Trusting that
pair would put the entry in a month node built from a month
that isn't there, so precision is capped at what the string
actually carries.
@ -31,6 +31,7 @@
═══════════════════════════════════════════════════════════════ */
import { Hono } from "hono";
import { marks } from "../shape.js";
const history = new Hono();
@ -38,7 +39,6 @@ const CACHE = "public, max-age=60, stale-while-revalidate=300";
const json = (c, body) => c.json(body, 200, { "Cache-Control": CACHE });
const marks = (n) => Array(n).fill("?").join(",");
/* 'YYYY' → year, 'YYYY-MM' → month, 'YYYY-MM-DD' → day. */
function precisionOfString(date) {
@ -115,7 +115,7 @@ history.get("/history", (c) => {
)
.all();
// How many entries exist but can't be placed. Worth knowing about —
// How many entries exist but can't be placed. Worth knowing about,
// an entry nobody gave a date to is invisible, and silence is how it
// stays that way.
const undated = db
@ -153,7 +153,7 @@ function loadRosters(db, rows) {
const teamIds = [...new Set(teamEntries.map((row) => row.ref_id))];
// v_org_leadership already decides who counts as current and
// public — affiliation still open, marked public, person
// public, affiliation still open, marked public, person
// published. Restating those conditions here is how they drift.
const members = db
.prepare(

View file

@ -1,12 +1,12 @@
/* ═══════════════════════════════════════════════════════════════
PEOPLE ROUTES — read-only, mounted under /api
PEOPLE ROUTES: read-only, mounted under /api
GET /teams/:id/people current public members of a team
GET /people?ids=a,b,c named people, any order
GET /people/:id one person's page
The team route reads v_org_leadership, which already decides who
counts as current and public — affiliation still open, marked
counts as current and public, affiliation still open, marked
public, person published. Restating those conditions here is how
they drift apart.
@ -21,7 +21,7 @@
import { Hono } from "hono";
import { asBool, loadBlocks, loadLinks, paragraphs, splitLinks } from "../shape.js";
import { asBool, loadBlocks, loadLinks, marks, paragraphs, splitLinks } from "../shape.js";
const people = new Hono();
@ -29,7 +29,6 @@ const CACHE = "public, max-age=60, stale-while-revalidate=300";
const json = (c, body) => c.json(body, 200, { "Cache-Control": CACHE });
const marks = (n) => Array(n).fill("?").join(",");
/* How many slugs one request may name. Keeps the URL sane. */
const MAX_IDS = 50;
@ -55,7 +54,7 @@ function shapePerson(row) {
}
/* people.bio is one run of prose with blank lines between
paragraphs — unrelated to shape.js's paragraphs(), which turns
paragraphs, unrelated to shape.js's paragraphs(), which turns
content_block rows into text. */
function splitParagraphs(text) {
if (!text) return null;
@ -144,7 +143,7 @@ people.get("/people", (c) => {
the same visibility rules its own page applies: a role needs a
public affiliation and a published organization, an event must
be published, an award must be published and the citation
public. A hidden team drops its name rather than the role —
public. A hidden team drops its name rather than the role,
the seat is still real, it just has no page to link to.
Roles are current and past. v_org_leadership only knows

View file

@ -3,7 +3,7 @@
Blocks and links are polymorphic: any organization, event, person
or team can own them. Every list endpoint therefore needs the
same move — fetch the parent rows, then fetch all their children
same move, fetch the parent rows, then fetch all their children
in one query each and stitch.
The alternative is a query per row, which at a dozen events is
@ -99,7 +99,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
const itemRows = db
.prepare(
`SELECT i.block_id, i.text, i.detail, i.url,
i.day, i.time, i.location, i.description, i.media, i.map,
i.day, i.time, i.location, i.description, i.media, i.media_alt, i.map,
p.id AS person_id, p.display_name AS person_name,
p.photo AS person_photo, p.tagline AS person_tagline
FROM content_block_items i
@ -122,6 +122,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
location: row.location,
description: row.description,
media: row.media,
media_alt: row.media_alt,
map: row.map,
person: row.person_id
? {
@ -139,7 +140,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
/* ── Card description ──────────────────────────────────────────
The card slot is paragraphs by convention, so it collapses to
an array of strings — desc_a and desc_b become description[0]
an array of strings, desc_a and desc_b become description[0]
and description[1]. A non-paragraph block in the card slot is
ignored here; put it in the body slot instead.
───────────────────────────────────────────────────────────── */
@ -172,7 +173,7 @@ export function splitLinks(links = []) {
collapse from seven flags to a list of the ticked ones, Sunday
first; an empty list means "starts_on's weekday", which the
client resolves since it already holds starts_on. Occurrences
are not sent — they are derived, and the client derives them
are not sent, they are derived, and the client derives them
against its own today. Shared by /events and /front-page.
───────────────────────────────────────────────────────────── */
const SERIES_WEEKDAYS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
@ -300,3 +301,6 @@ export function loadFeaturedCards(db, ownerKind, ownerId) {
}
export { asBool };
// "?,?,?" for an IN (...) list of n values.
export const marks = (n) => Array(n).fill("?").join(",");

View file

@ -12,7 +12,7 @@ export default function Banner() {
try {
if (!localStorage.getItem(storageKey)) setVisible(true);
} catch {
setVisible(true); // storage blocked — show it anyway
setVisible(true); // storage blocked, show it anyway
}
}, [storageKey]);

View file

@ -43,7 +43,7 @@ const BODY = '#4a6b72'
export default function ContentBlocks({
blocks,
accent = '#138ba0',
accent = '#0f7183',
className = '',
}: {
blocks?: ContentBlock[] | null

View file

@ -3,7 +3,7 @@
NGU's dove, lifted from the original home page. The path and its
two transforms are the drawing as exported, untouched; only the
wrapper changed — sized by the caller, coloured by currentColor,
wrapper changed, sized by the caller, coloured by currentColor,
and hidden from screen readers since it's decoration wherever
it appears.

View file

@ -78,7 +78,7 @@ function Card({ card }: { card: FeaturedCard }) {
const text = (
<div className="flex flex-1 flex-col p-6">
{card.eyebrow && (
<p className="text-xs font-bold uppercase tracking-[0.2em] text-[#138ba0]">{card.eyebrow}</p>
<p className="text-xs font-bold uppercase tracking-[0.2em] text-[#0f7183]">{card.eyebrow}</p>
)}
{card.title && (
<h3 className="mt-2 font-display text-xl font-extrabold leading-snug text-[#073d4a]">

View file

@ -40,13 +40,13 @@ const Footer_Links = [
];
const footerLinkClass =
"text-white/40 hover:text-[#aac992] text-sm transition-colors";
"text-white/65 hover:text-[#aac992] text-sm transition-colors";
const pageLinkClass =
"text-white/80 hover:text-[#aac992] text-sm font-semibold transition-colors";
const sectionLinkClass =
"text-white/45 hover:text-[#aac992] text-sm transition-colors";
"text-white/65 hover:text-[#aac992] text-sm transition-colors";
const headingClass = "text-white/90 text-sm font-semibold mb-4";
@ -67,7 +67,7 @@ export default function Footer() {
<br />
{Organization_Details.cityLine}
<br />
<span className="text-white/40">({Organization_Details.addressNote})</span>
<span className="text-white/65">({Organization_Details.addressNote})</span>
</address>
<p className="mt-3 max-w-xl text-sm leading-relaxed text-white/60">
{Organization_Details.nonprofit} Tax ID: {Organization_Details.taxId}.
@ -111,7 +111,7 @@ export default function Footer() {
target="_blank"
rel="noopener noreferrer"
className="inline-block mt-8 px-6 py-2.5 rounded-full text-sm font-bold text-white whitespace-nowrap transition-all duration-200 hover:scale-105"
style={{ background: "linear-gradient(135deg, #008fa8, #88b668)" }}
style={{ background: "#0f7183" }}
>
Support Us
</a>
@ -161,7 +161,7 @@ export default function Footer() {
</div>
<div className="border-t border-white/10 pt-8 flex flex-col md:flex-row items-center justify-between gap-4">
<p className="text-white/40 text-sm">© 2026 Next Generation of Unity. All rights reserved.</p>
<p className="text-white/65 text-sm">© 2026 Next Generation of Unity. All rights reserved.</p>
<div className="flex gap-6">
{Footer_Links.map((link) => (
<Link key={link.label} to={link.to} className={footerLinkClass}>

View file

@ -39,6 +39,15 @@ export function Anchor({
className?: string
style?: CSSProperties
}) {
// A stored link with some other scheme (javascript:, data:) draws
// as plain text rather than a link.
if (isExternalUrl(href) && !SAFE_URL.test(href)) {
return (
<span className={className} style={style}>
{children}
</span>
)
}
if (isExternalUrl(href)) {
const app = /^(mailto|tel):/i.test(href)
return (

View file

@ -1,7 +1,7 @@
import { useState, useEffect, useRef } from "react";
import { NavLink, Link, Outlet, useLocation } from "react-router-dom";
import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
import Banner from "./Banner.jsx";
import Banner from "./Banner.tsx";
import nguLogo from "../assets/logos/NGU_Logo.svg";
import Footer from "./Footer.tsx";
@ -25,7 +25,7 @@ const ACTION_VARIANTS: Record<
},
fancy: {
className: "font-bold text-white hover:scale-105",
style: { background: "linear-gradient(135deg, #008fa8, #88b668)" },
style: { background: "#0f7183" },
},
};
@ -73,6 +73,7 @@ export default function Layout() {
const [activeSection, setActiveSection] = useState<string | null>(null);
const [headerHeight, setHeaderHeight] = useState(72);
const headerRef = useRef<HTMLElement>(null);
const closeMenuRef = useRef<HTMLButtonElement>(null);
const location = useLocation();
const sections = PAGE_SECTIONS[location.pathname] ?? [];
@ -84,6 +85,16 @@ export default function Layout() {
setActiveSection(null);
}, [location.pathname]);
// The open menu is modal: focus starts on its close button, Escape
// shuts it, and everything behind it is inert (below).
useEffect(() => {
if (!mobileMenuOpen) return;
closeMenuRef.current?.focus();
const onKey = (e: KeyboardEvent) => e.key === "Escape" && setMobileMenuOpen(false);
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [mobileMenuOpen]);
// The header grows and shrinks: the banner can be dismissed and the
// subnav only exists on some pages. Measure it instead of guessing,
// so the spacer below always matches.
@ -140,17 +151,24 @@ export default function Layout() {
return (
<div className="min-h-screen overflow-x-hidden">
<a
href="#main"
className="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-full focus:bg-white focus:px-4 focus:py-2 focus:font-semibold focus:text-[#073d4a]"
>
Skip to content
</a>
{/* ── NAV ─────────────────────────────────────────────── */}
<header
ref={headerRef}
className="fixed top-0 left-0 right-0 z-50 backdrop-blur-md"
inert={mobileMenuOpen}
>
{/* Tier 0 — site-wide announcement */}
{/* Tier 0, site-wide announcement */}
<Banner />
{/* Tier 1 — site navigation */}
{/* Tier 1, site navigation */}
<nav
className="flex items-center justify-between px-6 py-4"
aria-label="Site"
@ -201,7 +219,7 @@ export default function Layout() {
</div>
</nav>
{/* Tier 2 — sections of the current page */}
{/* Tier 2, sections of the current page */}
{sections.length > 0 && (
<nav
className="hidden md:flex items-center px-6 py-2"
@ -211,7 +229,7 @@ export default function Layout() {
borderBottom: "1px solid rgba(45,200,224,0.15)",
}}
>
<span className="text-xs text-white/45">{activePage?.label}</span>
<span className="text-xs text-white/65">{activePage?.label}</span>
{/* Separates the page label from its sections */}
<span
@ -244,20 +262,26 @@ export default function Layout() {
<div aria-hidden style={{ height: headerHeight }} />
{/* Page content */}
<main>
<main id="main" tabIndex={-1} className="outline-none" inert={mobileMenuOpen}>
<Outlet />
</main>
{/*Site Footer applied to every page*/}
<div inert={mobileMenuOpen}>
<Footer />
</div>
{/* Mobile menu */}
{mobileMenuOpen && (
<div
className="fixed inset-0 z-40 flex flex-col items-center justify-center overflow-y-auto py-16"
className="fixed inset-0 z-[60] flex flex-col items-center justify-center overflow-y-auto py-16"
style={{ background: "rgba(7,61,74,0.97)" }}
role="dialog"
aria-modal="true"
aria-label="Menu"
>
<button
ref={closeMenuRef}
className="absolute top-5 right-6 text-white text-3xl"
aria-label="Close menu"
onClick={() => setMobileMenuOpen(false)}

View file

@ -4,10 +4,10 @@
sections with a thin accent banner between them, alternating
backgrounds, and a left-aligned heading with a blurb and rule.
Whatever goes inside a section is passed as `content` — the shell
Whatever goes inside a section is passed as `content`, the shell
doesn't care what it is.
No <main> and no footer here — Layout provides both, so a page
No <main> and no footer here, Layout provides both, so a page
using this shell drops straight into the router's Outlet.
Usage:
@ -20,7 +20,7 @@
title: "Local Chapters",
blurb: "Optional line under the section heading.",
accent: "#138ba0", // heading, banner, rule
accent: "#0f7183", // heading, banner, rule
background: "#eef9fb",
actions: <SomeButton />, // optional, right of the heading
content: <YourStuff />,
@ -33,7 +33,7 @@ import { useEffect, type ReactNode } from "react";
import { documentTitle } from "../lib/site.ts";
const TEAL = "#138ba0";
const TEAL = "#0f7183";
export type ShellSection = {
id: string;
@ -58,7 +58,7 @@ export function Section({ section }: { section: ShellSection }) {
blurb,
accent,
background,
// Optional action bar for this section's heading row — a view
// Optional action bar for this section's heading row, a view
// toggle, a filter, a link. Whatever the section needs; the
// shell just gives it a place to sit.
actions,
@ -71,11 +71,11 @@ export function Section({ section }: { section: ShellSection }) {
className="py-20"
style={{ background, scrollMarginTop: "5rem" }}
>
{/* Heading — left aligned, optional actions on the right */}
{/* Heading, left aligned, optional actions on the right */}
<div className="max-w-6xl mx-auto px-6 mb-10">
<div className="flex flex-wrap items-end justify-between gap-4">
<div>
<h2 className="text-4xl md:text-5xl font-800" style={{ color: accent }}>
<h2 className="text-4xl md:text-5xl font-extrabold" style={{ color: accent }}>
{title}
</h2>
{blurb && <p className="mt-2 text-[#4a6b72] max-w-xl">{blurb}</p>}
@ -103,7 +103,7 @@ export default function PageShell({ title, intro, sections }: PageShellProps) {
{/* Page header */}
<div className="pt-24 pb-12 px-6" style={{ background: "#eef9fb" }}>
<div className="max-w-6xl mx-auto">
<h1 className="text-5xl md:text-6xl font-800" style={{ color: TEAL }}>
<h1 className="text-5xl md:text-6xl font-extrabold" style={{ color: TEAL }}>
{title}
</h1>
{intro && <p className="mt-3 text-lg text-[#4a6b72] max-w-2xl">{intro}</p>}

View file

@ -2,8 +2,8 @@
PAGE STATE
The three ways a detail page can fail to be a detail page. All
four of them need the same thing, and it should be the same thing
— a visitor who hits a dead retreat link and a dead chapter link
four of them need the same thing, and it should be the same thing:
a visitor who hits a dead retreat link and a dead chapter link
shouldn't get two different pages.
Rendered inside PageShell so the chrome doesn't flicker in and
@ -17,7 +17,7 @@
import { Link } from 'react-router-dom'
import PageShell from './PageShell.tsx'
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
export default function PageState({

View file

@ -1,4 +1,4 @@
/* PeopleTiles — polaroid-style people list.
/* PeopleTiles, polaroid-style people list.
Everything is scoped under .pl and driven by custom properties, so a section
can retune it inline: <PeopleTiles style={{ "--pl-base-w": "150px" }} /> */
@ -13,7 +13,7 @@
--pl-radius: 3px;
/* color */
--pl-accent: #138ba0;
--pl-accent: #0f7183;
--pl-frame-bg: #fff;
--pl-frame-edge: rgba(15, 23, 42, 0.1);
--pl-photo-bg: #e7edef;

View file

@ -12,10 +12,11 @@ import { Link } from "react-router-dom";
import { get } from "../lib/api.ts";
import { isBadId, personHref } from "../lib/hrefs.ts";
import { initials, personPhoto } from "../lib/media.ts";
import "./PeopleTiles.css";
/**
* PeopleTiles — a horizontal, polaroid-style people list.
* PeopleTiles, a horizontal, polaroid-style people list.
*
* Supply data any of four ways:
*
@ -32,7 +33,7 @@ import "./PeopleTiles.css";
* is_owner flag.
*
* With `peopleslug`, the person is fetched by id and any other key
* on the entry overrides what came back — so a title can be given
* on the entry overrides what came back, so a title can be given
* per placement, and is blank when it isn't. A slug entry can sit
* beside a fully-written person in the same array.
*
@ -41,7 +42,7 @@ import "./PeopleTiles.css";
* md photo + name + title
* lg photo + name + title, and a chevron on anyone who has
* something to expand: pronouns, home organization, location,
* public email or a bio. Not bio alone — the details panel is
* public email or a bio. Not bio alone, the details panel is
* worth opening before anyone has written prose.
*
* Field names follow the API (is_owner, location_label), so a row
@ -50,8 +51,8 @@ import "./PeopleTiles.css";
* Profiles
* A person with a string id is taken to be a people row and links
* to /people/:id. A tile with nothing to expand is that link; an
* expandable one stays the button that opens its panel — a link
* can't sit inside a button — and the panel carries the link
* expandable one stays the button that opens its panel, a link
* can't sit inside a button, and the panel carries the link
* instead. A hand-written entry with no id links nowhere.
*/
@ -135,7 +136,7 @@ const SIZE_FEATURES: Record<PeopleTilesSize, { title: boolean; details: boolean
/* ── Data ──────────────────────────────────────────────────────
Fetching lives here rather than in every section, but the view
below stays pure — it only ever sees resolved groups, whatever
below stays pure, it only ever sees resolved groups, whatever
produced them.
───────────────────────────────────────────────────────────── */
@ -289,7 +290,7 @@ function collectSlugs(
}
/* The fetched record is the base; anything else on the entry wins,
including an explicit null — that's how a title is deliberately
including an explicit null, that's how a title is deliberately
left blank rather than inherited. */
function resolveAll(
list: PersonInput[],
@ -547,7 +548,7 @@ function Tile({
const content = (
<span className="pl__frame">
<span className="pl__photo">
<Photo src={photoSrc(person.photo)} name={person.name} />
<Photo src={personPhoto(person.photo)} name={person.name} />
</span>
<span className="pl__caption">
<span className="pl__name">{person.name}</span>
@ -740,7 +741,7 @@ function findByKey(groups: PeopleGroup[], key: string | null) {
}
/* The seat they hold here, or what they're called when there is no
seat — the same fallback content.js applies to leadership rows. */
seat, the same fallback content.js applies to leadership rows. */
function titleOf(person: Person): string | null {
return person.title || person.tagline || null;
}
@ -760,23 +761,7 @@ function hasDetails(person: Person): boolean {
);
}
/* Database rows carry a bare filename; a hand-written entry may
give a path or a full URL. Both should work. */
function photoSrc(photo?: string | null): string | null {
if (!photo) return null;
if (/^(https?:|\/|data:)/.test(photo)) return photo;
return `/people/${photo}`;
}
function initials(name = ""): string {
return name
.trim()
.split(/\s+/)
.slice(0, 2)
.map((word) => word[0] || "")
.join("")
.toUpperCase();
}
function resolveOrg(org: Person["org"]) {
if (!org) return null;

View file

@ -71,7 +71,7 @@ function Avatar({ person, size }: { person: NonNullable<ContentBlockItem['person
) : (
<span
aria-hidden="true"
className={`${size} flex shrink-0 items-center justify-center rounded-full bg-[#eef9fb] text-xs font-bold text-[#138ba0]`}
className={`${size} flex shrink-0 items-center justify-center rounded-full bg-[#eef9fb] text-xs font-bold text-[#0f7183]`}
>
{initials(person.name)}
</span>
@ -165,7 +165,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
</div>
)}
{graphic && <img src={graphic} alt="" loading="lazy" className="w-full rounded-lg" />}
{graphic && <img src={graphic} alt={entry.media_alt ?? ""} loading="lazy" className="w-full rounded-lg" />}
{place && (
<div>

View file

@ -16,7 +16,7 @@ import { useState } from 'react'
import HomeLink from '../pages/sections/home/HomeLink.tsx'
import { playingSource, videoSource, videoThumbnail } from '../lib/embeds.ts'
const ACCENT = '#138ba0'
const ACCENT = '#0f7183'
export default function VideoPlayer({
url,

View file

@ -49,7 +49,7 @@ export type MediaItem = {
};
const button =
"rounded-full border border-[#138ba0] px-3 py-1 text-sm font-medium text-[#138ba0] " +
"rounded-full border border-[#138ba0] px-3 py-1 text-sm font-medium text-[#0f7183] " +
"transition-colors hover:bg-[#eef9fb] disabled:cursor-default disabled:opacity-50";
/* A light checkerboard, so a white logo on a transparent background
@ -172,7 +172,7 @@ export function UploadButton({
type="checkbox"
checked={keepOriginal}
onChange={(e) => setKeepOriginal(e.target.checked)}
className="h-3.5 w-3.5 rounded border-[#4a6b72]/40 text-[#138ba0]"
className="h-3.5 w-3.5 rounded border-[#4a6b72]/40 text-[#0f7183]"
/>
Keep original
</label>
@ -293,7 +293,7 @@ export function MediaPicker({
>
<div className="flex max-h-[85vh] flex-col">
<div className="flex flex-wrap items-center gap-3 border-b border-[#138ba0]/15 px-5 py-4">
<h2 className="text-lg font-semibold text-[#138ba0]">Choose an image</h2>
<h2 className="text-lg font-semibold text-[#0f7183]">Choose an image</h2>
<input
type="search"
value={query}
@ -498,7 +498,7 @@ export function LinkPreviewInput({
{busy ? "Fetching…" : "Fetch preview"}
</button>
{note && (
<span className={`text-xs ${note.tone === "ok" ? "text-[#138ba0]" : "text-[#b3261e]"}`}>
<span className={`text-xs ${note.tone === "ok" ? "text-[#0f7183]" : "text-[#b3261e]"}`}>
{note.text}
</span>
)}

View file

@ -101,8 +101,8 @@ export function SectionNav({ sections }: { sections: EditorSection[] }) {
aria-current={lit ? "location" : undefined}
className={`-ml-px flex w-full items-center gap-1.5 border-l-2 px-3 py-1.5 text-left text-sm transition-colors ${
lit
? "border-[#138ba0] font-semibold text-[#138ba0]"
: "border-transparent text-[#4a6b72] hover:border-[#138ba0]/40 hover:text-[#138ba0]"
? "border-[#138ba0] font-semibold text-[#0f7183]"
: "border-transparent text-[#4a6b72] hover:border-[#138ba0]/40 hover:text-[#0f7183]"
}`}
>
<Label section={section} />

View file

@ -240,7 +240,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
checked={value === 1 || value === true}
disabled={locked}
onChange={(e) => onChange(e.target.checked ? 1 : 0)}
className="h-4 w-4 rounded border-[#4a6b72]/40 text-[#138ba0] focus:ring-[#138ba0]/40 disabled:opacity-50"
className="h-4 w-4 rounded border-[#4a6b72]/40 text-[#0f7183] focus:ring-[#138ba0]/40 disabled:opacity-50"
/>
{helpText(field, row) ?? "Yes"}
</label>
@ -478,14 +478,14 @@ export function Repeater({
<button
type="button"
onClick={() => setOpen(new Set(list.map((_, i) => i)))}
className="hover:text-[#138ba0] hover:underline"
className="hover:text-[#0f7183] hover:underline"
>
Expand all
</button>
<button
type="button"
onClick={() => setOpen(new Set())}
className="hover:text-[#138ba0] hover:underline"
className="hover:text-[#0f7183] hover:underline"
>
Collapse all
</button>
@ -494,7 +494,7 @@ export function Repeater({
<button
type="button"
onClick={add}
className="ml-auto rounded-full border border-[#138ba0] px-3 py-1 text-sm font-medium text-[#138ba0] transition-colors hover:bg-[#eef9fb]"
className="ml-auto rounded-full border border-[#138ba0] px-3 py-1 text-sm font-medium text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
>
{spec.addLabel ?? "Add"}
</button>
@ -565,7 +565,7 @@ export function Repeater({
type="button"
onClick={() => toggle(index)}
aria-expanded={expanded}
className="flex min-w-0 flex-1 items-center gap-2 text-left text-sm font-medium text-[#26454c] hover:text-[#138ba0]"
className="flex min-w-0 flex-1 items-center gap-2 text-left text-sm font-medium text-[#26454c] hover:text-[#0f7183]"
>
<span
aria-hidden="true"

View file

@ -1,5 +1,5 @@
// Site-wide announcement banner. Set `enabled: false` to hide it entirely.
// Bump `id` whenever the message changes — that re-shows the banner to
// Bump `id` whenever the message changes, that re-shows the banner to
// people who dismissed the previous one.
export const SITE_BANNER = {

View file

@ -3,7 +3,7 @@
Used by the public form (to render the tiles) and the admin
triage view (to label them). The ids must match TYPES in
server/src/routes/feedback.js — that list stays separate because
server/src/routes/feedback.js, that list stays separate because
the server isn't in this workspace, and it's the thing that
decides what's storable.

View file

@ -2,7 +2,7 @@
* Decade headers for the history page.
*
* Not in the database on purpose. There are four of them, they change
* about never, and they're editorial voice rather than record — the same
* about never, and they're editorial voice rather than record, the same
* reasoning that keeps the map grid config in code. A table for four
* rows that nobody edits is a migration and an admin page for nothing.
*
@ -12,7 +12,7 @@
* date is ever revised.
*/
import type { DecadeMeta } from '../lib/timeline'
import type { DecadeMeta } from '../lib/timeline.ts'
export const HISTORY_DECADES: DecadeMeta[] = [
{

View file

@ -3,7 +3,7 @@
Pure layout. Where each tile sits, what it's called, and how to
work out which tile a chapter belongs to. None of this is in the
database because none of it changes — Rhode Island will not be
database because none of it changes, Rhode Island will not be
moving, and no admin form should offer to move it.
What IS in the database is which regions cover which areas, and
@ -13,8 +13,6 @@
as regions with no tile.
═══════════════════════════════════════════════════════════════ */
export const GRID_COLS = 13;
export const GRID_ROWS = 7;
/* ── States ────────────────────────────────────────────────────
[column, row], both 1-based. A tile grid rather than true
@ -86,8 +84,8 @@ export const AREAS = Object.freeze([
export const AREA_BY_CODE = Object.fromEntries(AREAS.map((a) => [a.code, a]));
/* ── Which tile a chapter sits on ──────────────────────────────
The database stores a real address — state_code for US, and a
country code otherwise — rather than a tile name. This is the
The database stores a real address, state_code for US, and a
country code otherwise, rather than a tile name. This is the
one place that translates between the two, so adding a Mexico
band later means a line here and nothing in SQL.
@ -115,7 +113,7 @@ export function areaForChapter(chapter) {
A region with share 1 and no edge fills the tile. A shared
tile has one row per region, each declaring its own slice, so
California is two entries of 0.5 rather than a primary plus a
remainder — no arithmetic, and the renderer doesn't need to
remainder, no arithmetic, and the renderer doesn't need to
know which region "really" owns it.
regionAreas [{ region_id, area_code, share, edge, note }]
@ -165,10 +163,3 @@ export function countChaptersByArea(chapters: any[] = []) {
from the row rather than being looked up in a splits table and
branched on whether this region is the primary.
───────────────────────────────────────────────────────────── */
export function areasLabel(regionId, regionAreas: any[] = []) {
return regionAreas
.filter((row) => row.region_id === regionId && row.area_code !== "CANADA")
.map((row) => (row.note ? `${row.area_code} (${row.note})` : row.area_code))
.sort()
.join(", ");
}

View file

@ -1,299 +0,0 @@
/**
* PLACEHOLDER DATA — delete this file once `GET /api/history` lands.
*
* Shaped exactly like the aggregation route's payload, so swapping it out
* is a two-line change in History.tsx.
*
* Note what is and isn't here. Entries that point at a record carry a
* `ref` and little else: no venue, no host name, no copy that also lives
* in `events`. The few that do carry a title are overriding it on
* purpose. Titles and blurbs below are invented scaffolding, not real NGU
* history — replace them before anyone sees this.
*
* Decade headers are not here — they live in historyDecades.ts and stay
* in code even after the API lands.
*
* Upcoming items are not flagged. `partitionByDate` decides what's
* upcoming by comparing dates to the wall clock, so nothing here needs
* editing as dates pass.
*/
import type { TimelineItem } from '../lib/timeline'
export const MOCK_ITEMS: TimelineItem[] = [
// ——— Upcoming (relative to the wall clock, not a flag) ———
{
id: 'tl-0001',
date: '2027-06',
precision: 'month',
kind: 'event',
title: 'Summer Conference 2027',
meta: 'Unity Village, MO',
ref: { kind: 'event', id: 'summer-2027' },
logo: { file: 'summer-conference.svg', kind: 'event' },
},
{
id: 'tl-0002',
date: '2026-11-14',
precision: 'day',
kind: 'event',
title: 'Fall Regional Rally',
meta: 'Southeast',
ref: { kind: 'event', id: 'fall-rally-2026' },
logo: { file: 'regional-rally.svg', kind: 'event' },
},
{
id: 'tl-0003',
date: '2026-10-03',
precision: 'day',
kind: 'event',
title: 'Chapter Leads Intensive',
meta: 'Online',
ref: { kind: 'event', id: 'leads-intensive-2026' },
},
// ——— 2020s ———
{
id: 'tl-0010',
date: '2026-03',
precision: 'month',
kind: 'organization',
title: 'Twentieth chapter chartered',
blurb:
'The first new charter in the region since 2017, started by three people who met at a rally two summers earlier.',
featured: true,
ref: { kind: 'organization', id: 'boise', orgKind: 'chapter' },
logo: { file: 'boise.svg', kind: 'organization' },
},
{
id: 'tl-0011',
date: '2026-04-17',
precision: 'day',
kind: 'event',
title: 'Spring Regional Rally',
ref: { kind: 'event', id: 'spring-rally-2026' },
logo: { file: 'regional-rally.svg', kind: 'event' },
},
{
id: 'tl-0012',
date: '2026-01',
precision: 'month',
kind: 'people',
title: 'New leadership team seated',
blurb: 'A four-person exec on a two-year term, the first under the 2024 bylaws.',
ref: { kind: 'team', id: 'ngu-leadership' },
team: { id: 'ngu-leadership', name: 'Leadership Team', orgId: 'ngu', orgName: 'NGU National' },
people: [
{ id: 'jane-doe', name: 'Jane Doe', title: 'Chair', photo: 'jane-doe.jpg' },
{ id: 'sam-ruiz', name: 'Sam Ruiz', title: 'Vice Chair', photo: 'sam-ruiz.jpg' },
{ id: 'ada-mensah', name: 'Ada Mensah', title: 'Secretary' },
{ id: 'tom-baird', name: 'Tom Baird', title: 'Treasurer', photo: 'tom-baird.jpg' },
],
},
{
id: 'tl-0013',
date: '2025-12-28',
precision: 'day',
kind: 'event',
title: 'Winter Gathering',
ref: { kind: 'event', id: 'winter-gathering-2025' },
},
{
id: 'tl-0014',
date: '2025-07-19',
precision: 'day',
kind: 'award',
title: 'Service Award',
meta: 'Presented to the Southeast chapter leads',
ref: { kind: 'award', id: 'service' },
logo: { file: 'service-award.svg', kind: 'award' },
},
{
id: 'tl-0015',
date: '2025-07-17',
precision: 'day',
kind: 'event',
title: 'Summer Conference',
meta: 'Three days, 140 attendees',
ref: { kind: 'event', id: 'summer-2025' },
logo: { file: 'summer-conference.svg', kind: 'event' },
},
{
id: 'tl-0016',
date: '2025',
precision: 'year',
kind: 'milestone',
title: 'Photo archive digitized',
blurb: 'Roughly 4,000 images from 2003 onward, scanned by volunteers.',
href: 'https://archive.nextgenerationofunity.org',
},
{
id: 'tl-0017',
date: '2024-09',
precision: 'month',
kind: 'milestone',
title: 'Bylaws rewritten',
blurb:
'Term limits, a defined handoff window, and the first written process for chartering a chapter.',
featured: true,
},
{
id: 'tl-0018',
date: '2024-07-11',
precision: 'day',
kind: 'event',
title: 'Summer Conference',
ref: { kind: 'event', id: 'summer-2024' },
logo: { file: 'summer-conference.svg', kind: 'event' },
},
{
id: 'tl-0019',
date: '2024-07-13',
precision: 'day',
kind: 'award',
title: 'Emerging Leader Award',
meta: 'First year the award was given',
ref: { kind: 'award', id: 'emerging-leader' },
logo: { file: 'emerging-leader.svg', kind: 'award' },
},
{
id: 'tl-0020',
date: '2022-06',
precision: 'month',
kind: 'event',
title: 'First in-person rally since 2019',
blurb: 'Sixty-one people, most of whom had only ever met on a video call.',
featured: true,
ref: { kind: 'event', id: 'return-rally-2022' },
},
{
id: 'tl-0021',
date: '2021-08',
precision: 'month',
kind: 'event',
title: 'Online Summer Intensive',
meta: 'Six sessions across two weeks',
ref: { kind: 'event', id: 'online-intensive-2021' },
},
{
id: 'tl-0022',
date: '2020-03',
precision: 'month',
kind: 'milestone',
title: 'All gatherings suspended',
blurb: 'Weekly online rooms started the following week and ran for 118 weeks.',
},
// ——— 2010s ———
{
id: 'tl-0030',
date: '2018-05',
precision: 'month',
kind: 'organization',
title: 'Eighth region recognized',
featured: true,
ref: { kind: 'organization', id: 'northwest', orgKind: 'region' },
logo: { file: 'northwest.svg', kind: 'organization' },
},
{
id: 'tl-0031',
date: '2018-07-20',
precision: 'day',
kind: 'event',
title: 'Summer Conference',
ref: { kind: 'event', id: 'summer-2018' },
logo: { file: 'summer-conference.svg', kind: 'event' },
},
{
id: 'tl-0032',
date: '2016-02',
precision: 'month',
kind: 'people',
title: 'Retreat Team formed',
blurb:
'Programming had been whoever volunteered. This made it a standing team with a handoff.',
ref: { kind: 'team', id: 'ngu-retreat-team' },
team: { id: 'ngu-retreat-team', name: 'Retreat Team', orgId: 'ngu', orgName: 'NGU National' },
people: [
{ id: 'marcus-hale', name: 'Marcus Hale', title: 'Founding lead', photo: 'marcus-hale.jpg' },
{ id: 'priya-nair', name: 'Priya Nair', photo: 'priya-nair.jpg' },
],
},
{
id: 'tl-0033',
date: '2015-07',
precision: 'month',
kind: 'award',
title: 'First Service Award presented',
blurb: 'Created to name the work that had been going unnamed for a decade.',
featured: true,
ref: { kind: 'award', id: 'service' },
logo: { file: 'service-award.svg', kind: 'award' },
},
{
id: 'tl-0034',
date: '2015-02',
precision: 'month',
kind: 'milestone',
title: 'Shared calendar goes live',
blurb: 'Regions stop scheduling on top of each other.',
},
{
id: 'tl-0035',
date: '2012-06',
precision: 'month',
kind: 'event',
title: 'Summer Conference',
meta: 'The year attendance first passed 100',
ref: { kind: 'event', id: 'summer-2012' },
logo: { file: 'summer-conference.svg', kind: 'event' },
},
{
id: 'tl-0036',
date: '2012',
precision: 'year',
kind: 'milestone',
title: 'Adopted the name Next Generation of Unity',
},
// ——— 2000s ———
{
id: 'tl-0040',
date: '2009',
precision: 'year',
kind: 'milestone',
title: 'Four regions drawn on a map for the first time',
},
{
id: 'tl-0041',
date: '2005-08',
precision: 'month',
kind: 'milestone',
title: 'The gathering becomes annual',
blurb: 'Before this it happened when someone had the energy to organize it.',
featured: true,
},
{
id: 'tl-0042',
date: '2002-08',
precision: 'month',
kind: 'event',
title: 'First young adult retreat',
meta: 'Nineteen attendees',
blurb:
'Organized over six weeks at a borrowed retreat center. Everything else on this page follows from it.',
featured: true,
ref: { kind: 'event', id: 'first-retreat-2002' },
},
// ——— Pre-program ———
{
id: 'tl-0050',
date: '1997',
precision: 'year',
kind: 'milestone',
title: 'Regional youth programs running independently',
blurb:
'Not NGU, and not connected to each other — but the people who started NGU came out of these.',
},
]

View file

@ -1,7 +1,10 @@
@import '@fontsource/montserrat/400.css';
@import '@fontsource/montserrat/600.css';
@import '@fontsource/montserrat/700.css';
@import '@fontsource/poppins/400.css';
@import '@fontsource/poppins/600.css';
@import '@fontsource/poppins/700.css';
@import '@fontsource/poppins/800.css';
@import 'tailwindcss';
@ -18,6 +21,28 @@ html {
scroll-behavior: smooth;
}
/* One visible focus ring for keyboard users, wherever a component
doesn't draw its own. */
:focus-visible {
outline: 2px solid #0f7183;
outline-offset: 2px;
}
/* Visitors who ask for less motion get no smooth scrolling, slides
or hover zooms. */
@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
body {
font-family: 'Montserrat', sans-serif;
background-color: #ffffff;
@ -30,38 +55,11 @@ h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
/* Gradient utilities */
.grad-brand {
background: linear-gradient(135deg, #073d4a 0%, #138ba0 45%, #10d48a 100%);
}
.grad-brand-light {
background: linear-gradient(135deg, #0a5260 0%, #17aac4 50%, #00e676 100%);
}
.grad-dark {
background: linear-gradient(135deg, #042f3a 0%, #073d4a 60%, #0a5260 100%);
}
.grad-hero-text {
background: linear-gradient(90deg, #88b668 0%, #008fa8 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Scrollbar hide */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(19, 139, 160, 0.4); border-radius: 3px; }
/* Float animation */
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-12px); }
}
.float-anim { display: inline-block; animation: float 4s ease-in-out infinite; will-change: transform;}
.ig-icon { fill: currentColor; transition: fill 200ms ease; }

View file

@ -452,6 +452,13 @@ const blocksChild = {
help: "Optional, in the fold-out: a map of the site, a slide, a poster",
when: SCHEDULE_ENTRY,
},
{
path: "media_alt",
label: "Graphic description",
full: true,
help: "For screen readers: what the graphic shows, eg. a map of the camp. Default: skipped as decoration.",
when: SCHEDULE_ENTRY,
},
{
path: "map",
label: "Map",
@ -1496,6 +1503,12 @@ const blogPosts = {
help: "A sentence or two for the card. Default: the body's first paragraph.",
},
{ path: "cover_image", label: "Cover image", widget: "image", resolve: blogImage, full: true },
{
path: "cover_alt",
label: "Cover description",
full: true,
help: "For screen readers: what the cover shows. Default: skipped as decoration.",
},
],
},
{

View file

@ -2,21 +2,14 @@
API CLIENT
One place that knows how to talk to the server, so components
never call fetch directly and swapping the transport later is a
single-file change.
Two things worth knowing about the design:
never call fetch directly.
The cache is a module-level Map of in-flight and settled
promises. Two components asking for /events during the same
render pass share one request, and a remount inside the TTL
costs nothing. It resets on page load, which is the right
lifetime for content that changes weekly.
Every reader can pass a `fallback`. If the request fails, that
value is used instead. This is what keeps the Figma preview
working: pass the old static module as the fallback and the
preview renders real content with no server in sight.
lifetime for content that changes weekly. A failure isn't
cached, and surfaces as an error rather than empty data.
═══════════════════════════════════════════════════════════════ */
const BASE = import.meta.env?.VITE_API_BASE ?? "/api";
@ -38,8 +31,8 @@ export class ApiError extends Error {
async function request(path, options: RequestInit = {}) {
const response = await fetch(`${BASE}${path}`, {
headers: { Accept: "application/json", ...options.headers },
...options,
headers: { Accept: "application/json", ...options.headers },
});
if (response.status === 204) return null;
@ -68,20 +61,15 @@ async function request(path, options: RequestInit = {}) {
/* ── Reads ─────────────────────────────────────────────────────
get("/events") → cached for 60s
get("/events", { ttl: 0 }) → always fresh
get("/events", { fallback }) → fallback on any failure
───────────────────────────────────────────────────────────── */
export function get(path, { ttl = DEFAULT_TTL, fallback }: { ttl?: number; fallback?: any } = {}) {
export function get(path, { ttl = DEFAULT_TTL }: { ttl?: number } = {}) {
const hit = cache.get(path);
if (hit && Date.now() - hit.at < ttl) return hit.promise;
const promise = request(path).catch((err) => {
cache.delete(path); // a failure shouldn't be cached
if (fallback !== undefined) {
console.warn(`api: ${path} failed, using fallback`, err);
return fallback;
}
throw err;
});

View file

@ -9,7 +9,7 @@
RequireAuth guards routes. Worth being clear about what that
does and doesn't do: it hides the interface, not the data. The
protection is the 401 from /api/admin — this only stops someone
protection is the 401 from /api/admin, this only stops someone
staring at an empty table.
═══════════════════════════════════════════════════════════════ */
@ -71,7 +71,7 @@ export function useAuth() {
return value;
}
/* Signals a session that ended while the page was open — the
/* Signals a session that ended while the page was open, the
admin pages call this when a request comes back 401. */
export function isUnauthorized(error) {
return error instanceof ApiError && error.status === 401;

View file

@ -3,7 +3,7 @@
The chapter map's view of the organization list. Regions and
chapters are the same table and the same endpoint; this hook
reshapes them into what a map needs — slices per tile, counts
reshapes them into what a map needs, slices per tile, counts
per tile, chapters grouped by region.
Its return shape is unchanged from the version that called
@ -14,7 +14,7 @@
the tile grid src/data/mapGrid.ts. Where a state sits never
changes, so it isn't worth a round trip.
the fetch src/data/organizations.ts. One endpoint for
the fetch src/lib/organizations.ts. One endpoint for
every kind, so a section listing regions and
a section listing partners read alike.
═══════════════════════════════════════════════════════════════ */
@ -23,18 +23,14 @@ import { useMemo } from "react";
import {
areasSentence,
initialsFor,
byName,
useOrganizations,
} from "./organizations.ts";
import {
areaForChapter,
buildAreaSlices,
countChaptersByArea,
} from "./mapGrid.ts";
const byName = (a, b) => a.name.localeCompare(b.name);
export { initialsFor };
} from "../data/mapGrid.ts";
export function useCommunity() {
const regionsQuery = useOrganizations("region");

View file

@ -2,7 +2,7 @@
EVENT DATA
One request, filtered per band. The Retreats page has three
bands of events, and all three call this hook — the cache in
bands of events, and all three call this hook, the cache in
api.ts keys on the path, so they share a single fetch and each
narrows the result to what it shows.
@ -33,7 +33,7 @@
import { useMemo } from "react";
import { useResource } from "../lib/useResource.ts";
import { useResource } from "./useResource.ts";
/* One shared empty list, so a memo keyed on `scopes` doesn't
restart on every render before the data arrives. */
@ -54,7 +54,7 @@ export function useEvents({ scope, host, status, type }: any = {}) {
let list = all ?? [];
if (scope) list = list.filter(e => e.scope_id === scope);
// `host` is an organization or a person slug, and an event can
// have several of either — co-hosting puts one event on both
// have several of either, co-hosting puts one event on both
// hosts' lists, which is the point.
if (host) list = list.filter(e => e.hosts?.some(h => h.id === host));
if (status) list = list.filter(e => e.status === status);
@ -68,9 +68,9 @@ export function useEvents({ scope, host, status, type }: any = {}) {
return { events, scopes, loading, error };
}
/* Past and upcoming, split. `status` arrives already resolved — the
explicit value when there is one, otherwise derived from ends_on
— so nothing here needs to know which of the two it got. */
/* Past and upcoming, split. `status` arrives already resolved, the
explicit value when there is one, otherwise derived from ends_on,
so nothing here needs to know which of the two it got. */
export function splitByStatus(events: any[] = []) {
const upcoming: any[] = [];
const past: any[] = [];

View file

@ -14,7 +14,7 @@
Dates are 'YYYY-MM-DD' and are handled as UTC midnights so that
stepping a day never lands on a DST gap. They are calendar dates,
not instants — nothing here converts timezones.
not instants, nothing here converts timezones.
═══════════════════════════════════════════════════════════════ */
export type SeriesFrequency = 'weekly' | 'monthly_date' | 'monthly_weekday'
@ -76,7 +76,7 @@ const daysInMonth = (year: number, month: number) =>
new Date(Date.UTC(year, month + 1, 0)).getUTCDate()
/* 1st–4th, or 5 for a date in the month's fifth week, which the
schedule treats as "last" — every month has a last Tuesday, not
schedule treats as "last", every month has a last Tuesday, not
every month has a fifth. */
const weekOfMonth = (date: Date) => Math.ceil(date.getUTCDate() / 7)

View file

@ -19,6 +19,8 @@
means the site offers a filter the database will refuse to store.
═══════════════════════════════════════════════════════════════ */
import { capitalize } from './text.ts'
export type EventType = 'retreat' | 'class' | 'workshop' | 'meeting' | 'other'
export const EVENT_TYPES: { id: EventType; label: string; plural: string }[] = [
@ -29,14 +31,10 @@ export const EVENT_TYPES: { id: EventType; label: string; plural: string }[] = [
{ id: 'other', label: 'Other', plural: 'Other' },
]
export const EVENT_TYPE_IDS: EventType[] = EVENT_TYPES.map((entry) => entry.id)
const BY_ID = new Map<string, { label: string; plural: string }>(
EVENT_TYPES.map((entry) => [entry.id as string, entry]),
)
const capitalize = (word: string) =>
word ? word.charAt(0).toUpperCase() + word.slice(1) : ''
/* A value the CHECK has gained since this file was written renders
as itself rather than vanishing, the same rule EventDetail's
@ -44,5 +42,3 @@ const capitalize = (word: string) =>
export const eventTypeLabel = (id?: string | null): string =>
(id ? BY_ID.get(id)?.label : null) ?? capitalize(id ?? '')
export const eventTypePlural = (id?: string | null): string =>
(id ? BY_ID.get(id)?.plural : null) ?? capitalize(id ?? '')

View file

@ -2,7 +2,7 @@
PUBLIC HREFS
One place that turns a record into a URL. The API deliberately
never sends paths — it sends `{ kind, id }` and, for an
never sends paths, it sends `{ kind, id }` and, for an
organization, the `org_kind` that decides which of the three
routes a slug belongs to. Deciding that in each component is how
/regions/x and /chapters/x end up both existing for the same
@ -20,7 +20,7 @@
Every builder takes an id the caller believed it had. When it
doesn't, the old behaviour was to interpolate the string
"undefined" into a path, render a link to it, mount a page and
fetch /api/organizations/undefined — four steps between the
fetch /api/organizations/undefined, four steps between the
mistake and any sign of it, none of which name the component
that made it.
@ -35,7 +35,7 @@ export type RefKind = 'event' | 'organization' | 'team' | 'award' | 'person'
/* A region, a chapter and a partner read as different things to a
visitor even though they are one table, so they get one route
each. 'national' is NGU itself — one record, no listing to sit
each. 'national' is NGU itself, one record, no listing to sit
under, so it falls through to the generic path. */
const ORG_BASE: Record<string, string> = {
region: '/regions',
@ -49,7 +49,7 @@ const ORG_BASE: Record<string, string> = {
* /events/:id, not /retreats/:id. The listing page is called
* Retreats because that's what NGU calls the gatherings it hosts,
* but the records are `events`, the API route is /api/events, and
* plenty of them — partner events, conferences — aren't retreats
* plenty of them, partner events, conferences, aren't retreats
* at all. Naming the record route after one page's editorial
* framing would have been wrong the first time a non-retreat got
* its own page.
@ -73,7 +73,7 @@ function checkId(id: unknown, what: string): string {
if (DEV) {
// console.error rather than warn: this is always a bug, and the
// stack is the whole point — it names the component that passed
// stack is the whole point, it names the component that passed
// nothing.
console.error(
`hrefs: ${what}() was given ${JSON.stringify(id)}. ` +
@ -93,7 +93,7 @@ function checkId(id: unknown, what: string): string {
* have to agree about what counts as an id.
*
* It lives here rather than next to the hook that calls it because
* it is a path, and paths are this file's job — and because a
* it is a path, and paths are this file's job, and because a
* component that interpolates a missing route param produces the
* literal string "undefined", which the server cannot tell apart
* from a slug somebody genuinely typed. It answers 404 either way,
@ -122,8 +122,8 @@ export function orgHref(id?: string | null, kind?: string | null): string {
return `${ORG_BASE[kind ?? ''] ?? '/organizations'}/${checkId(id, 'orgHref')}`
}
/* For anything holding a polymorphic reference — timeline entries,
content blocks — where the kind arrives as data rather than being
/* For anything holding a polymorphic reference, timeline entries,
content blocks, where the kind arrives as data rather than being
known at the call site.
Returns null for a kind with no page AND for a reference with no
@ -153,12 +153,6 @@ export function refHref(
}
/* What to call the kind in a breadcrumb or a back link. */
export const ORG_KIND_LABEL: Record<string, string> = {
national: 'Next Generation of Unity',
region: 'Region',
chapter: 'Chapter',
partner: 'Partner organization',
}
/* Where "back" goes from a record page. A chapter belongs to
/community, a retreat to /retreats. */

View file

@ -24,10 +24,6 @@
const ABSOLUTE = /^(https?:|\/|data:)/
/* An uploaded file ('/uploads/…'), a path anywhere on the site, or
a full URL: something to use as it is rather than resolve. */
export const isAbsoluteMedia = (file?: string | null) => Boolean(file && ABSOLUTE.test(file))
function inDir(dir: string) {
return (file?: string | null): string | null => {
if (!file) return null

View file

@ -9,7 +9,7 @@
const { organizations } = useOrganizations("partner");
const { organizations } = useOrganizations(); // all
Every organization has the same card surface — name, colour,
Every organization has the same card surface, name, colour,
logo, description, links. What differs by kind sits under
`details`, so a list component can render the common parts
without knowing what it's holding:
@ -23,9 +23,8 @@
fetch.
═══════════════════════════════════════════════════════════════ */
import { useResource } from "../lib/useResource.ts";
import { useResource } from "./useResource.ts";
const EMPTY = { organizations: [] };
export function useOrganizations(kind) {
const path = kind
@ -79,6 +78,8 @@ export function areasSentence(areas: any[] = []) {
/* Initials for a card with no logo. "NGU Lynnwood" → "NL", dropping
the org prefix so every card doesn't read "NG". */
export const byName = (a, b) => a.name.localeCompare(b.name);
export function initialsFor(name = "") {
return name
.replace(/^NGU\s+/i, "")

View file

@ -24,7 +24,7 @@ import { useState } from "react";
}
Sections fetch their own data. The page never does, which is why
there's no loading or error state here — each view handles its
there's no loading or error state here, each view handles its
own, and one section failing doesn't blank the page.
Every Component receives `accent` so its empty and error notices

View file

@ -40,8 +40,6 @@ export const siteUrl = (path: string): string => new URL(path, SITE_ORIGIN).href
const PAGES: Record<string, PageText> = { ...siteConfiguration.pages, ...fromServer.pages }
/** The static pages site.json knows, for the admin's page list. */
export const SITE_PAGE_PATHS: string[] = Object.keys(siteConfiguration.pages)
/** A static page's title and intro, from site.json's "pages". */
export function sitePage(path: string): PageText {
const page = PAGES[path]

View file

@ -21,3 +21,6 @@ export function preview(text: string | null | undefined, max: number): string {
const clean = lastSpace > max / 2 ? cut.slice(0, lastSpace) : cut
return `${clean.replace(/[\s.,;:!?]+$/, '')}…`
}
export const capitalize = (word: string) =>
word ? word.charAt(0).toUpperCase() + word.slice(1) : ''

View file

@ -11,14 +11,14 @@
* date are read back from `events` at query time. Editing the event
* therefore edits the timeline, and there is no second copy to drift.
*
* Hand-authored entries — "bylaws rewritten", "the gathering becomes
* annual" — carry no ref and supply their own title and blurb. An entry
* Hand-authored entries, "bylaws rewritten", "the gathering becomes
* annual", carry no ref and supply their own title and blurb. An entry
* may also do both: reference an event but override its title, for when
* the timeline wants to say something the event card doesn't.
*
* ── What the server resolves, and what it doesn't ──────────────────────
* The server resolves *data*: title, date, logo filename, the members of
* a referenced team. It does not resolve *routes* or *asset paths* —
* a referenced team. It does not resolve *routes* or *asset paths*,
* those are presentation, and live in `timelineRefs.ts` so React Router
* and the public/ layout stay the frontend's business.
*/
@ -41,7 +41,7 @@ export type RefKind = 'event' | 'organization' | 'award' | 'person' | 'team'
export type TimelineRef = {
kind: RefKind
/** The row's TEXT primary key — an event id, org slug, team slug. */
/** The row's TEXT primary key, an event id, org slug, team slug. */
id: string
/** Only on organizations: history.js copies v_timeline.org_kind. */
orgKind?: OrgKind
@ -59,7 +59,7 @@ export type TimelineLogo = {
export type PersonRef = {
id: string
name: string
/** people.photo — filename only. */
/** people.photo, filename only. */
photo?: string
/** Their affiliation title at the time, if it's worth printing. */
title?: string
@ -78,7 +78,7 @@ export type TimelineItem = {
id: string
/** "2014" | "2014-06" | "2014-06-12" */
date: string
/** How much of `date` is trustworthy. Authoritative — a backfilled row
/** How much of `date` is trustworthy. Authoritative, a backfilled row
* may hold a full date while only the year is actually known. */
precision: DatePrecision
kind: TimelineKind
@ -127,7 +127,7 @@ export type GroupedYear = {
featured: boolean
count: number
featuredItems: TimelineItem[]
/** Year-precision items — known to be this year, month unknown. */
/** Year-precision items, known to be this year, month unknown. */
undated: TimelineItem[]
months: GroupedMonth[]
}
@ -238,7 +238,7 @@ export type GroupOptions = {
programStartYear?: number
/**
* Repeat featured items inside their month node as well as in the
* featured block. Off by default — in a sparse year it just prints the
* featured block. Off by default, in a sparse year it just prints the
* same line twice. A month left with nothing but featured items drops
* out entirely.
*/

View file

@ -4,7 +4,7 @@
Turns a timeline item into a destination and an image. Both were
answered locally here before, which is how the timeline came to
link events at /event/:id while the router only knew about
/retreats/:id — two files holding the same opinion, one of them
/retreats/:id, two files holding the same opinion, one of them
wrong, neither aware of the other.
Now this file knows about timeline items and nothing else. Where
@ -13,9 +13,9 @@
── The shape this reads, from history.js ──
item.href explicit link_url override, may be off-site
item.ref { kind, id, orgKind? } — orgKind only on
item.ref { kind, id, orgKind? }, orgKind only on
organizations, because only they have it
item.logo { file, kind } — v_timeline COALESCEs the
item.logo { file, kind }, v_timeline COALESCEs the
filename across five tables, so the kind is
what says which directory it came from
item.team { id, name, orgId? } on a team ref
@ -23,7 +23,7 @@
Every one of those is optional. An entry is a standalone
milestone until proven otherwise, and the two accessors below
return null rather than assuming a shape that isn't there —
return null rather than assuming a shape that isn't there,
which is the other half of the /organizations/undefined bug:
reaching into a ref that wasn't sent yields undefined, and
undefined interpolates into a path perfectly happily.
@ -44,7 +44,7 @@ import type { TimelineItem } from './timeline.ts'
* Otherwise the reference decides, and refHref returns null for a
* kind with no page yet ('person', until /people/:id exists) as
* well as for a ref that didn't resolve. Null means the entry
* renders as a plain <div> — right for a milestone, and right for
* renders as a plain <div>, right for a milestone, and right for
* a reference that's missing an id, which used to render as a link
* to a 404.
*/
@ -67,7 +67,7 @@ export function logoSrc(item: TimelineItem): string | null {
}
/**
* A roster member's photo. Same rule as everywhere else — the API
* A roster member's photo. Same rule as everywhere else, the API
* sends a bare filename.
*/
export function photoSrc(photo?: string | null): string | null {

View file

@ -24,6 +24,7 @@ export type BlogPostRecord = {
title: string
excerpt?: string | null
cover_image?: string | null
cover_alt?: string | null
published_on?: string | null
tags: string[]
authors: BlogAuthor[]

View file

@ -1,11 +1,11 @@
/**
* The four detail endpoints, typed.
*
* Adding a fifth is a type and a one-line hook — useRecord owns
* Adding a fifth is a type and a one-line hook, useRecord owns
* the fetching, the caching and the 404.
*
* An id that is missing — or the literal string "undefined", which
* is what a template literal makes of a missing route param — never
* An id that is missing, or the literal string "undefined", which
* is what a template literal makes of a missing route param, never
* reaches the network. detailPath returns null and the hook reports
* notFound, which is what the visitor should see anyway, and
* hrefs.ts has already logged the component that produced it.
@ -56,6 +56,8 @@ export type ContentBlockItem = {
location?: string | null
description?: string | null
media?: string | null
/** The graphic's alt text; blank means decorative. */
media_alt?: string | null
map?: string | null
person?: { id: string; name: string; photo?: string | null; tagline?: string | null } | null
}
@ -145,8 +147,6 @@ export type EventListItem = Omit<EventRecord, 'blocks' | 'people' | 'awards'>
/** An event_scopes row, as GET /events sends it beside the list. */
export type EventScope = { id: string; name: string; sort_order: number }
export type EventsResponse = { scopes: EventScope[]; events: EventListItem[] }
export const useEvent = (id?: string): Resource<EventRecord> =>
useRecord<EventRecord>(detailPath('/events', id), 'event')
@ -251,14 +251,12 @@ export type OrganizationListItem = Omit<OrganizationRecord, 'teams' | 'awards' |
sort_order: number
}
export type OrganizationsResponse = { organizations: OrganizationListItem[] }
export const useOrganization = (id?: string): Resource<OrganizationRecord> =>
useRecord<OrganizationRecord>(detailPath('/organizations', id), 'organization')
/* ── Teams ───────────────────────────────────────────────────── */
/** No members here on purpose — PeopleTiles fetches
/** No members here on purpose, PeopleTiles fetches
* /teams/:id/people itself. See the note in content.js. */
export type TeamRecord = {
id: string

View file

@ -14,20 +14,16 @@
* callers, so aborting on unmount would cancel someone else's
* request. The `live` flag drops the result instead.
*
* No `fallback` on purpose. Handing this the mock data would render a
* plausible-looking history with no indication the server is down, and
* the wrong history is worse than a visible error — the same reason
* `fallback: EMPTY` came out elsewhere.
*
* `undated` is the number of published entries the API left out because
* nothing gave them a date. Not rendered publicly — a visitor can't act
* on it — but returned so it's reachable if you want a warning in the
* nothing gave them a date. Not rendered publicly, a visitor can't act
* on it, but returned so it's reachable if you want a warning in the
* admin later.
*/
import { useCallback, useEffect, useState } from 'react'
import { get, invalidate, ApiError } from './api.ts'
import type { TimelineItem } from './timeline'
import type { TimelineItem } from './timeline.ts'
const PATH = '/history'

View file

@ -1,10 +1,10 @@
/**
* useRecord — one record from one endpoint, on the useHistory
* useRecord, one record from one endpoint, on the useHistory
* pattern.
*
* Named for what it returns, and deliberately not useResource:
* src/lib/useResource.ts is a different hook — it hands back the
* whole response body and takes an options object — and a .ts file
* src/lib/useResource.ts is a different hook, it hands back the
* whole response body and takes an options object, and a .ts file
* of the same name would sit one extension away from it. An import
* whose target goes missing then resolves to the other file without
* a word, and every detail page renders the wrapper object instead
@ -43,7 +43,7 @@
* A null `path` means there is nothing to ask for, and the hook
* reports notFound rather than loading forever. Callers build the
* path with detailPath() from hrefs.ts, which returns null for an
* id that could never be real — "undefined" chief among them.
* id that could never be real, "undefined" chief among them.
*/
import { useCallback, useEffect, useState } from 'react'

View file

@ -3,13 +3,7 @@
The read hook every page uses:
const { data, error, loading } = useResource("/events", {
fallback: { events: EVENTS }, // the old static module
});
Deliberately small. If the site ever needs mutation, refetch on
focus, or pagination, that's the point to reach for TanStack
Query rather than growing this file.
const { data, error, loading } = useResource("/events");
Note the `ignore` flag rather than an AbortController: the
request is shared and cached, so cancelling it would throw away
@ -20,22 +14,15 @@
import { useEffect, useState } from "react";
import { get } from "./api.ts";
export function useResource(path, { ttl, fallback }: { ttl?: number; fallback?: any } = {}) {
// Seed with the fallback so the first paint has content when one
// is available, rather than flashing a spinner and then the same
// data a moment later.
const [state, setState] = useState<any>(() => ({
data: fallback,
error: null,
loading: true,
}));
export function useResource(path, { ttl }: { ttl?: number } = {}) {
const [state, setState] = useState<any>({ data: undefined, error: null, loading: true });
useEffect(() => {
let ignore = false;
setState((prev) => ({ ...prev, loading: true, error: null }));
get(path, { ttl, fallback })
get(path, { ttl })
.then((data) => {
if (!ignore) setState({ data, error: null, loading: false });
})
@ -46,7 +33,7 @@ export function useResource(path, { ttl, fallback }: { ttl?: number; fallback?:
return () => {
ignore = true;
};
}, [path, ttl]); // fallback is intentionally not a dependency
}, [path, ttl]);
return state;
}

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
SITE VERSION — src/lib/version.ts
SITE VERSION: src/lib/version.ts
One string, bumped by hand when the working directory name
changes. The admin footer is the only thing reading it today;
@ -7,4 +7,4 @@
box or a build banner can read the same value later.
═══════════════════════════════════════════════════════════════ */
export const SITE_VERSION = "NGU-Web.v1.8.3-video-mgmt";
export const SITE_VERSION = "NGU-Web.v1.9.0-audit";

View file

@ -1,6 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import App from './App.tsx'
import './index.css'
ReactDOM.createRoot(document.getElementById('root')!).render(

View file

@ -1,14 +1,14 @@
/* ═══════════════════════════════════════════════════════════════
AWARD DETAIL — /awards/:id
AWARD DETAIL: /awards/:id
The thinnest of the four, by design. `awards` has no links and no
content blocks — 'award' isn't in the owner_kind CHECK on either
content blocks, 'award' isn't in the owner_kind CHECK on either
polymorphic table, and widening it means rebuilding two STRICT
tables. `description` is the prose.
So the recipients are the page. They're rendered as a list rather
than as PeopleTiles because each one carries a citation, and a
citation is the point of an award — it doesn't belong folded
citation is the point of an award, it doesn't belong folded
behind a chevron.
Note also that `awards` has no is_published column: every row
@ -24,7 +24,7 @@ import { useAward, type Recipient } from '../lib/useContent.ts'
import { eventHref, orgHref, personHref } from '../lib/hrefs.ts'
import { awardLogo, initials, personPhoto } from '../lib/media.ts'
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
export default function AwardDetail() {

View file

@ -19,7 +19,7 @@ import PeopleTiles from '../components/PeopleTiles.tsx'
import { blogImage, personPhoto } from '../lib/media.ts'
import { postDate, useBlogPost } from '../lib/useBlog.ts'
const ACCENT = '#138ba0'
const ACCENT = '#0f7183'
const BODY = '#4a6b72'
/* Where "back" goes: the section on the Community page. */
@ -87,7 +87,7 @@ export default function BlogPost() {
</div>
{cover && (
<img src={cover} alt="" className="aspect-video w-full rounded-2xl object-cover" />
<img src={cover} alt={post.cover_alt ?? ""} className="aspect-video w-full rounded-2xl object-cover" />
)}
<ContentBlocks blocks={post.blocks} accent={ACCENT} />

View file

@ -30,7 +30,7 @@ const SECTIONS = [
title: "Local Chapters",
blurb:
"Young adult groups meeting in person and online across the movement.",
accent: "#138ba0",
accent: "#0f7183",
background: "#eef9fb",
Component: OrgListMap,
views: { options: ["map", "grid"], default: "map", Toggle: OrgMapToggle },
@ -77,7 +77,7 @@ export default function CommunityPage() {
id: "blog",
title: blog?.title || BLOG_DEFAULT_TITLE,
blurb: blog?.blurb ?? undefined,
accent: "#138ba0",
accent: "#0f7183",
background: "#ffffff",
Component: CommunityBlog,
},

View file

@ -1,9 +1,9 @@
/* ═══════════════════════════════════════════════════════════════
EVENT DETAIL — /retreats/:id
EVENT DETAIL: /retreats/:id
Reached from the cards on Retreats.tsx. The API has already
resolved the fallbacks — `color` is the event's own or its first
host's, `status` is derived from the dates when nobody set it —
resolved the fallbacks, `color` is the event's own or its first
host's, `status` is derived from the dates when nobody set it,
so nothing here reimplements those rules.
Hosts arrive as a list in billing order, each one either an
@ -33,12 +33,13 @@ import { awardHref, personHref, refHref } from '../lib/hrefs.ts'
import { personPhoto } from '../lib/media.ts'
import { eventTypeLabel } from '../lib/eventTypes.ts'
import { occurrenceLabel, seriesLabel, seriesTimes, upcomingOccurrences } from '../lib/eventSeries.ts'
import { capitalize } from '../lib/text.ts'
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
/* Billing order. A role missing from here still renders, at the
end, under its own name — better than a speaker vanishing
end, under its own name, better than a speaker vanishing
because somebody added a role to the CHECK and not to this list. */
const ROLE_ORDER = [
'speaker',
@ -262,7 +263,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
{/* Outlined rather than filled: the status pill is the one
thing in this strip that should read as loud, and two
solid blocks side by side would compete. Shown
unconditionally — a card suppresses its own type badge in
unconditionally, a card suppresses its own type badge in
a band of one kind, but here there is no band to make it
redundant. */}
{event.event_type && (
@ -297,7 +298,7 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
/* One host reads as "Hosted by Northwest"; several read as a
sentence, so they're joined with commas and an "and" rather than
stacked. A host whose id didn't resolve to a route renders as
plain text — refHref returns null for that — because a dead link
plain text, refHref returns null for that, because a dead link
is worse than a name. */
function HostList({ hosts, accent }: { hosts: EventHost[]; accent: string }) {
return (
@ -327,7 +328,7 @@ function HostList({ hosts, accent }: { hosts: EventHost[]; accent: string }) {
)
}
/* date_label is what a card shows and is free text — "March/April
/* date_label is what a card shows and is free text, "March/April
2026" is legitimate. This is only the fallback for an event that
has dates and no label. */
function dateRange(start?: string | null, end?: string | null): string | null {
@ -398,4 +399,3 @@ function peopleGroups(people: EventPerson[], accent: string): PeopleGroupInput[]
}))
}
const capitalize = (word: string) => word.charAt(0).toUpperCase() + word.slice(1)

View file

@ -1,6 +1,6 @@
import PageShell from "../components/PageShell";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import FeedbackForm from "./sections/FeedbackForm";
import FeedbackForm from "./sections/FeedbackForm.tsx";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/feedback");
@ -9,7 +9,7 @@ const PAGE = sitePage("/feedback");
Feedback page.
Section ids match the nav hashes. Right now there's one:
#website. Add more entries to SECTIONS as the page grows —
#website. Add more entries to SECTIONS as the page grows,
program feedback, retreat surveys, etc.
The form itself lives in sections/FeedbackForm, including its
@ -17,7 +17,7 @@ const PAGE = sitePage("/feedback");
This file only decides where it sits on the page.
═══════════════════════════════════════════════════════════════ */
const ACCENT = "#138ba0";
const ACCENT = "#0f7183";
const SECTIONS = [
{

View file

@ -10,7 +10,7 @@ const GIVING_URL =
const MODAL_SCRIPT_SRC = "https://js.churchcenter.com/modal/v1";
const ACCENT = "#138ba0";
const ACCENT = "#0f7183";
function useChurchCenterModal() {
useEffect(() => {

View file

@ -1,8 +1,8 @@
import PageShell from "../components/PageShell";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import HistoryTimeline from "./sections/history/HistoryTimeline";
import { HISTORY_DECADES } from "../data/historyDecades";
import { useHistory } from "../lib/useHistory";
import HistoryTimeline from "./sections/history/HistoryTimeline.tsx";
import { HISTORY_DECADES } from "../data/historyDecades.ts";
import { useHistory } from "../lib/useHistory.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/history");
@ -10,11 +10,11 @@ const PAGE = sitePage("/history");
/**
* Year the program starts. Decades ending before this render with the
* pre-program treatment, so the gap moves if the founding date is ever
* corrected — no hardcoded 2000 anywhere in the components.
* corrected, no hardcoded 2000 anywhere in the components.
*/
const PROGRAM_START_YEAR = 2000;
const ACCENT = "#138ba0";
const ACCENT = "#0f7183";
const BACKGROUND = "#ffffff";
export default function History() {
@ -22,7 +22,7 @@ export default function History() {
// Section renders `content` outside its own max-width wrapper, so the
// container lives here. The custom properties bind the timeline to
// this section's accent and background — --tl-surface must match
// this section's accent and background, --tl-surface must match
// `background` or the rail will show through the year dots.
const wrap = (children: React.ReactNode) => (
<div
@ -51,7 +51,7 @@ export default function History() {
<button
type="button"
onClick={reload}
className="mt-3 rounded-full border border-[#138ba0] px-4 py-1.5 text-sm font-medium text-[#138ba0] transition-colors hover:bg-[#eef9fb]"
className="mt-3 rounded-full border border-[#138ba0] px-4 py-1.5 text-sm font-medium text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
>
Try again
</button>

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
HOME — /
HOME: /
Not a PageShell page: the front page has no title bar, and each
band draws its own heading in its own style.
@ -8,7 +8,7 @@
The hero comes first, always. After it, the bands in the order
the admin dragged them into, minus any they hid. Which component
draws a band is decided here, in SECTIONS, keyed on the same list
the CHECK on front_page_sections holds — the database says "retreats,
the CHECK on front_page_sections holds, the database says "retreats,
third, called National Retreats"; this file says what a retreats
band looks like.
@ -51,7 +51,7 @@ type BandProps = {
}
/* Default headings for a band the admin didn't title, and how each
one renders. The ids are the page anchors — #connect is what the
one renders. The ids are the page anchors, #connect is what the
hero's second button points at out of the box. */
const SECTIONS: Record<
FrontPageSectionKey,
@ -120,7 +120,7 @@ export default function Home() {
<button
type="button"
onClick={reload}
className="mt-4 rounded-full border border-[#138ba0] px-5 py-2 font-semibold text-[#138ba0] hover:bg-[#eef9fb]"
className="mt-4 rounded-full border border-[#138ba0] px-5 py-2 font-semibold text-[#0f7183] hover:bg-[#eef9fb]"
>
Try again
</button>

View file

@ -10,7 +10,7 @@ const SECTIONS = [
id: "board-staff",
title: "Board & Staff",
blurb: "The people guiding Next Generation of Unity day to day.",
accent: "#138ba0",
accent: "#0f7183",
background: "#eef9fb",
content: (
<div className="max-w-6xl mx-auto px-6">
@ -22,7 +22,7 @@ const SECTIONS = [
id: "retreat-team",
title: "Retreat Team",
blurb: "Volunteers who plan and lead our gatherings throughout the year.",
accent: "#aac992",
accent: "#4a7a2f",
background: "#ffffff",
content: (
<div className="max-w-6xl mx-auto px-6">
@ -52,8 +52,8 @@ const SECTIONS = [
<div className="max-w-6xl mx-auto px-6">
<a
href="mailto:info@nextgenerationofunity.org"
className="inline-block py-2.5 px-6 rounded-xl font-700 transition-all duration-200 hover:scale-105"
style={{ border: "1px solid #138ba0", color: "#138ba0" }}
className="inline-block py-2.5 px-6 rounded-xl font-bold transition-all duration-200 hover:scale-105"
style={{ border: "1px solid #0f7183", color: "#0f7183" }}
>
info@nextgenerationofunity.org
</a>

View file

@ -5,8 +5,8 @@
One component behind four routes, because organizations are one
table. The kind decides which extras render, not which file runs.
The URL kind is decoration — the slug is what identifies the
record — so a request for /chapters/great-lakes when that slug is
The URL kind is decoration, the slug is what identifies the
record, so a request for /chapters/great-lakes when that slug is
a region redirects to the canonical path rather than rendering a
correct page at a wrong address.
@ -32,7 +32,7 @@ import {
import { orgHref, orgListHref, teamHref } from '../lib/hrefs.ts'
import { orgLogo, personPhoto } from '../lib/media.ts'
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
export default function OrganizationDetail() {
@ -57,7 +57,7 @@ export default function OrganizationDetail() {
// /chapters/x when x is a region: same record, wrong address.
//
// useLocation, not window.location: the latter is outside the
// router's awareness — always "/" under HashRouter, and free to
// router's awareness, always "/" under HashRouter, and free to
// be stale mid-navigation, either of which turns this into a
// redirect loop rather than a one-shot correction.
//
@ -232,7 +232,7 @@ export default function OrganizationDetail() {
})
}
// EventList-Cards fetches and renders this itself — its own
// EventList-Cards fetches and renders this itself, its own
// docstring offers `host` for exactly this case, and a card there
// already knows about gradients, logos, past-event collapsing and
// the carousel. A second grid here was the same component written
@ -414,7 +414,7 @@ function groupLeadership(org: OrganizationRecord): TeamBlock[] {
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.
// team. Usually the leads. No heading, they are the page.
if (loose.length > 0) {
blocks.push({ key: 'loose', teamId: null, label: null, people: loose })
}
@ -432,7 +432,7 @@ function groupLeadership(org: OrganizationRecord): TeamBlock[] {
}
// Whatever is left is filed under an unpublished team. Its page
// isn't reachable, so the heading is plain text — but the people
// 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({

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
PERSON DETAIL — /people/:id
PERSON DETAIL: /people/:id
Everything public that points at one person, gathered by
GET /people/:id in people.js. Visibility is decided there, the
@ -33,8 +33,9 @@ import {
import { awardHref, eventHref, orgHref, teamHref } from '../lib/hrefs.ts'
import { initials, personPhoto } from '../lib/media.ts'
import { eventTypeLabel } from '../lib/eventTypes.ts'
import { capitalize } from '../lib/text.ts'
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
const BACKGROUNDS = ['#ffffff', '#eef9fb']
@ -47,8 +48,6 @@ const ROLE_LABEL: Record<string, string> = {
member: 'Member',
}
const capitalize = (word: string) =>
word ? word.charAt(0).toUpperCase() + word.slice(1) : ''
export default function PersonDetail() {
const { id } = useParams()

View file

@ -1,4 +1,4 @@
import PageShell from "../components/PageShell.jsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
@ -9,7 +9,7 @@ const SECTIONS = [
id: "privacy",
title: "Privacy Policy",
blurb: "Last updated: [date]",
accent: "#138ba0",
accent: "#0f7183",
background: "#eef9fb",
content: (
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">

View file

@ -20,7 +20,7 @@ const SECTIONS = [
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 centre and the colours; a warning shows if the code might not scan.',
accent: '#138ba0',
accent: '#0f7183',
background: '#eef9fb',
content: (
<div className="mx-auto max-w-6xl px-6">

View file

@ -1,4 +1,4 @@
import PageShell from "../components/PageShell.jsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
@ -9,7 +9,7 @@ const SECTIONS = [
id: "unity",
title: "Unity Teachings",
blurb: "Core principles, readings, and study material from the Unity movement.",
accent: "#138ba0",
accent: "#0f7183",
background: "#eef9fb",
content: (
<div className="max-w-6xl mx-auto px-6">
@ -21,7 +21,7 @@ const SECTIONS = [
id: "branding",
title: "Branding & Marketing",
blurb: "Logos, colors, templates, and guidelines for representing NGU.",
accent: "#aac992",
accent: "#4a7a2f",
background: "#ffffff",
content: (
<div className="max-w-6xl mx-auto px-6">

View file

@ -10,7 +10,7 @@ const PAGE = sitePage("/retreats");
RETREATS PAGE
Three bands, all the same view of the same table with a
different filter. The page declares them and does nothing else —
different filter. The page declares them and does nothing else,
each section fetches its own slice.
Two filters per band now, and they answer different questions:
@ -29,7 +29,7 @@ const PAGE = sitePage("/retreats");
What this page deliberately does not show: local, international
and other scopes, and every non-retreat type. Those are reachable
from their host's page and by URL, and get a band here when
there's enough of them to fill one — see the block at the bottom.
there's enough of them to fill one, see the block at the bottom.
To reorder the page, move a line. To add a different kind of
section, add an entry with another Component.
@ -46,7 +46,7 @@ const SECTIONS = [
id: "national",
title: "National Retreats",
blurb: "Our flagship gatherings, open to young adults across the country.",
accent: "#138ba0",
accent: "#0f7183",
background: "#eef9fb",
Component: EventListCards,
props: { scope: "national", ...RETREATS },
@ -56,7 +56,7 @@ const SECTIONS = [
id: "regional",
title: "Regional Retreats",
blurb: "Smaller gatherings hosted by regions throughout the year.",
accent: "#aac992",
accent: "#4a7a2f",
background: "#ffffff",
Component: EventListCards,
props: { scope: "regional", ...RETREATS },
@ -74,14 +74,14 @@ const SECTIONS = [
},
/* The other three scopes, ready to uncomment. Each needs an accent
and a background of its own — those are presentation and live
and a background of its own, those are presentation and live
here, not in event_scopes.
{
id: "local",
title: "Local Events",
blurb: "Hosted by individual chapters.",
accent: "#d08a3c",
accent: "#9a5b17",
background: "#ffffff",
Component: EventListCards,
props: { scope: "local", ...RETREATS_ONLY },
@ -91,7 +91,7 @@ const SECTIONS = [
id: "international",
title: "International Events",
blurb: "Gatherings beyond the US.",
accent: "#3c7fd0",
accent: "#2f6bb5",
background: "#eef9fb",
Component: EventListCards,
props: { scope: "international", ...RETREATS_ONLY },
@ -101,7 +101,7 @@ const SECTIONS = [
id: "other",
title: "Other Events",
blurb: "Everything that doesn't fit the categories above.",
accent: "#7a8a8e",
accent: "#5d6c70",
background: "#ffffff",
Component: EventListCards,
props: { scope: "other", ...RETREATS_ONLY },

View file

@ -1,5 +1,5 @@
/* ═══════════════════════════════════════════════════════════════
TEAM DETAIL — /teams/:id
TEAM DETAIL: /teams/:id
teams.id is a global primary key rather than scoped to the
organization, which is what lets this route be flat: 'ngu-board'
@ -21,7 +21,7 @@ import PeopleTiles from '../components/PeopleTiles.tsx'
import { useTeam } from '../lib/useContent.ts'
import { orgHref } from '../lib/hrefs.ts'
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const BODY = '#4a6b72'
export default function TeamDetail() {

View file

@ -1,4 +1,4 @@
import PageShell from "../components/PageShell.jsx";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
@ -9,7 +9,7 @@ const SECTIONS = [
id: "terms",
title: "Terms of Service",
blurb: "Last updated: [date]",
accent: "#138ba0",
accent: "#0f7183",
background: "#eef9fb",
content: (
<div className="max-w-3xl mx-auto px-6 leading-relaxed text-[#2c4a50]">

View file

@ -19,7 +19,7 @@ import { Link } from "react-router-dom";
import { ApiError, del, get, post } from "../../lib/api.ts";
const TEAL = "#138ba0";
const TEAL = "#0f7183";
const MUTED = "#4a6b72";
const POLL_MS = 2000;
@ -81,9 +81,9 @@ function sizeOf(bytes: number | null): string {
}
const button =
"rounded-full border border-[#138ba0] px-4 py-2 text-sm font-semibold text-[#138ba0] transition-colors hover:bg-[#eef9fb] disabled:cursor-default disabled:opacity-50";
"rounded-full border border-[#138ba0] px-4 py-2 text-sm font-semibold text-[#0f7183] transition-colors hover:bg-[#eef9fb] disabled:cursor-default disabled:opacity-50";
const primary =
"rounded-full bg-[#138ba0] px-5 py-2.5 font-semibold text-white transition-colors hover:bg-[#0f7183] disabled:bg-[#4a6b72]/25";
"rounded-full bg-[#0f7183] px-5 py-2.5 font-semibold text-white transition-colors hover:bg-[#0b5c6a] disabled:bg-[#4a6b72]/25";
const input =
"rounded-lg border border-[#4a6b72]/25 bg-white px-3 py-2 text-sm text-[#26454c] outline-none focus:border-[#138ba0] focus:ring-2 focus:ring-[#138ba0]/25";
@ -103,7 +103,7 @@ function Status({ job }: { job: Job }) {
return (
<div className="mt-2">
<div className="h-2 overflow-hidden rounded-full bg-[#eef9fb]">
<div className="h-full bg-[#138ba0] transition-all" style={{ width: `${job.status === "queued" ? 0 : percent}%` }} />
<div className="h-full bg-[#0f7183] transition-all" style={{ width: `${job.status === "queued" ? 0 : percent}%` }} />
</div>
<p className="mt-1 text-xs" style={{ color: MUTED }}>
{job.status === "queued" ? "Waiting its turn…" : `${percent}%`}
@ -368,7 +368,7 @@ export default function AdminClips() {
return (
<div>
<div className="flex flex-wrap items-baseline gap-3">
<h1 className="text-2xl font-bold text-[#138ba0]">Video clips</h1>
<h1 className="text-2xl font-bold text-[#0f7183]">Video clips</h1>
<p className="text-sm" style={{ color: MUTED }}>
Cut clips from our YouTube and Facebook videos, for Reels, Shorts, the site or a podcast.
</p>

View file

@ -28,8 +28,8 @@ import { feedbackTypeLabel } from "../../data/feedbackTypes.ts";
const STATUSES = ["new", "read", "actioned", "archived", "spam"];
const STATUS_STYLE = {
new: "bg-[#138ba0] text-white",
read: "bg-[#eef9fb] text-[#138ba0]",
new: "bg-[#0f7183] text-white",
read: "bg-[#eef9fb] text-[#0f7183]",
actioned: "bg-[#eaf3e2] text-[#4a6b2f]",
archived: "bg-[#4a6b72]/10 text-[#4a6b72]",
spam: "bg-[#fdf3f2] text-[#b3261e]",
@ -117,7 +117,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
{row.email && (
<a
href={`mailto:${row.email}?subject=Your%20NGU%20site%20feedback`}
className="text-[#138ba0] underline underline-offset-2"
className="text-[#0f7183] underline underline-offset-2"
>
{row.email}
</a>
@ -165,7 +165,7 @@ function FeedbackCard({ row, onChange, onRemove, canWrite, canRemove }) {
type="button"
disabled={busy}
onClick={() => save({ admin_note: note })}
className="mt-2 rounded-full bg-[#138ba0] px-4 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-[#0f7183] disabled:bg-[#4a6b72]/25"
className="mt-2 rounded-full bg-[#0f7183] px-4 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-[#0b5c6a] disabled:bg-[#4a6b72]/25"
>
{busy ? "Saving…" : "Save note"}
</button>
@ -305,7 +305,7 @@ export default function AdminFeedback() {
return (
<div>
<h1 className="text-3xl font-bold text-[#138ba0]">Feedback</h1>
<h1 className="text-3xl font-bold text-[#0f7183]">Feedback</h1>
<p className="mt-2 text-sm text-[#4a6b72]">
{canWrite
? "Everything submitted through the site form."
@ -322,7 +322,7 @@ export default function AdminFeedback() {
className={
"rounded-full px-4 py-1.5 text-sm transition-colors " +
(status === tab.id
? "bg-[#138ba0] font-semibold text-white"
? "bg-[#0f7183] font-semibold text-white"
: "border border-[#4a6b72]/25 text-[#4a6b72] hover:border-[#138ba0]/50")
}
>
@ -387,7 +387,7 @@ export default function AdminFeedback() {
<button
type="button"
onClick={() => load(cursor)}
className="mt-6 rounded-full border border-[#138ba0] px-5 py-2 font-semibold text-[#138ba0] transition-colors hover:bg-[#eef9fb]"
className="mt-6 rounded-full border border-[#138ba0] px-5 py-2 font-semibold text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
>
Load older
</button>

View file

@ -36,7 +36,7 @@ function NavCard({ item }) {
return (
<div className="group relative flex flex-col rounded-2xl border border-[#138ba0]/20 bg-white p-5 transition-all hover:border-[#138ba0]/60 hover:shadow-sm">
<div className="flex items-baseline gap-3">
<h3 className="text-base font-semibold text-[#138ba0]">
<h3 className="text-base font-semibold text-[#0f7183]">
<Link
to={to}
className="after:absolute after:inset-0 after:rounded-2xl after:content-['']"
@ -46,7 +46,7 @@ function NavCard({ item }) {
</h3>
<span
aria-hidden="true"
className="ml-auto text-[#138ba0] opacity-0 transition-opacity group-hover:opacity-100"
className="ml-auto text-[#0f7183] opacity-0 transition-opacity group-hover:opacity-100"
>
→
</span>
@ -62,7 +62,7 @@ function NavCard({ item }) {
<Link
key={child.to}
to={child.to}
className="text-[#4a6b72] underline-offset-4 transition-colors hover:text-[#138ba0] hover:underline"
className="text-[#4a6b72] underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
>
{child.label}
</Link>
@ -77,7 +77,7 @@ function CardBlock({ title, blurb, children }) {
return (
<div className="mt-10">
<div className="flex items-baseline gap-3">
<h2 className="text-lg font-semibold text-[#138ba0]">{title}</h2>
<h2 className="text-lg font-semibold text-[#0f7183]">{title}</h2>
{blurb && <p className="text-sm text-[#4a6b72]">{blurb}</p>}
</div>
<div className="mt-4 grid gap-4 sm:grid-cols-2">{children}</div>
@ -114,7 +114,7 @@ export default function AdminHome() {
return (
<div className="grid gap-8 lg:grid-cols-[1fr_17rem] lg:items-start">
<div>
<h1 className="text-2xl font-bold text-[#138ba0]">
<h1 className="text-2xl font-bold text-[#0f7183]">
{user?.name ? `Welcome back, ${user.name.split(" ")[0]}.` : "Welcome back."}
</h1>
<p className="mt-1 text-[#4a6b72]">Pick a section to work in.</p>
@ -144,7 +144,7 @@ export default function AdminHome() {
<p className="mt-0.5 break-all text-xs text-[#4a6b72]/80">{user.email}</p>
)}
{role && (
<span className="mt-2 inline-block rounded-full bg-[#eef9fb] px-2.5 py-0.5 text-xs font-medium text-[#138ba0]">
<span className="mt-2 inline-block rounded-full bg-[#eef9fb] px-2.5 py-0.5 text-xs font-medium text-[#0f7183]">
{role}
</span>
)}
@ -156,7 +156,7 @@ export default function AdminHome() {
<li key={link.to}>
<Link
to={link.to}
className="underline-offset-4 transition-colors hover:text-[#138ba0] hover:underline"
className="underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
>
{link.label}
</Link>
@ -171,7 +171,7 @@ export default function AdminHome() {
href="/"
target="_blank"
rel="noreferrer"
className="mt-2 inline-block underline-offset-4 transition-colors hover:text-[#138ba0] hover:underline"
className="mt-2 inline-block underline-offset-4 transition-colors hover:text-[#0f7183] hover:underline"
>
View the public site ↗
</a>

View file

@ -45,8 +45,8 @@ import {
function GroupMenu({ item, lit, pathname }) {
const children = item.children ?? [];
const link = lit
? "font-semibold text-[#138ba0]"
: "text-[#4a6b72] transition-colors hover:text-[#138ba0]";
? "font-semibold text-[#0f7183]"
: "text-[#4a6b72] transition-colors hover:text-[#0f7183]";
return (
<div className="group relative">
@ -68,7 +68,7 @@ function GroupMenu({ item, lit, pathname }) {
to={child.to}
className={`block rounded-lg px-3 py-2 text-sm transition-colors hover:bg-[#eef9fb] ${
matches(pathname, child.to)
? "font-semibold text-[#138ba0]"
? "font-semibold text-[#0f7183]"
: "text-[#26454c]"
}`}
>
@ -130,7 +130,7 @@ export default function AdminLayout() {
const subnav = active?.children ?? [];
const wordmark = <span className="text-lg font-bold text-[#138ba0]">{areaTitle}</span>;
const wordmark = <span className="text-lg font-bold text-[#0f7183]">{areaTitle}</span>;
return (
<div className="flex min-h-screen flex-col bg-[#f6fbfc]">
@ -172,7 +172,7 @@ export default function AdminLayout() {
<button
type="button"
onClick={handleLogout}
className="rounded-full border border-[#4a6b72]/30 px-4 py-1.5 font-medium transition-colors hover:bg-[#eef9fb] hover:text-[#138ba0]"
className="rounded-full border border-[#4a6b72]/30 px-4 py-1.5 font-medium transition-colors hover:bg-[#eef9fb] hover:text-[#0f7183]"
>
Sign out
</button>
@ -190,8 +190,8 @@ export default function AdminLayout() {
to={child.to}
className={
child === activeChild
? "font-semibold text-[#138ba0]"
: "text-[#4a6b72] transition-colors hover:text-[#138ba0]"
? "font-semibold text-[#0f7183]"
: "text-[#4a6b72] transition-colors hover:text-[#0f7183]"
}
>
{child.label}

View file

@ -87,7 +87,7 @@ export default function AdminLogin() {
return (
<div className="flex min-h-screen items-center justify-center bg-[#eef9fb] px-6 py-16">
<div className="w-full max-w-sm">
<h1 className="text-3xl font-bold text-[#138ba0]">NGU admin</h1>
<h1 className="text-3xl font-bold text-[#0f7183]">NGU admin</h1>
<p className="mt-2 text-sm text-[#4a6b72]">
Sign in to edit the site.
</p>
@ -162,7 +162,7 @@ export default function AdminLogin() {
<button
type="submit"
disabled={busy || !email || !password}
className="mt-6 w-full rounded-full bg-[#138ba0] px-6 py-3 font-semibold text-white transition-colors hover:bg-[#0f7183] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#138ba0]/40 disabled:cursor-not-allowed disabled:bg-[#4a6b72]/25"
className="mt-6 w-full rounded-full bg-[#0f7183] px-6 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"
>
{busy ? "Signing in…" : "Sign in"}
</button>

View file

@ -113,7 +113,7 @@ function CopyPath({ url }: { url: string }) {
setTimeout(() => setCopied(false), 1500);
});
}}
className="text-xs text-[#138ba0] hover:underline"
className="text-xs text-[#0f7183] hover:underline"
>
{copied ? "Copied" : "Copy path"}
</button>
@ -128,7 +128,7 @@ export default function AdminMedia() {
return (
<div>
<div className="flex flex-wrap items-baseline gap-3">
<h1 className="text-2xl font-bold text-[#138ba0]">Media</h1>
<h1 className="text-2xl font-bold text-[#0f7183]">Media</h1>
<p className="text-sm text-[#4a6b72]">
Uploaded images. Image fields in every editor pick from here.
</p>
@ -169,7 +169,7 @@ export default function AdminMedia() {
href={item.url}
target="_blank"
rel="noreferrer"
className="text-xs text-[#138ba0] hover:underline"
className="text-xs text-[#0f7183] hover:underline"
>
Open
</a>

View file

@ -54,7 +54,7 @@ function Block({ title, note, children }: any) {
return (
<section className="mt-8 first:mt-0">
<div className="flex items-baseline gap-3">
<h2 className="text-lg font-semibold text-[#138ba0]">{title}</h2>
<h2 className="text-lg font-semibold text-[#0f7183]">{title}</h2>
{note && <p className="text-sm text-[#4a6b72]">{note}</p>}
</div>
<div className="mt-3">{children}</div>
@ -156,7 +156,7 @@ export default function AdminPanel() {
<button
type="button"
onClick={load}
className="mt-3 rounded-full border border-[#138ba0] px-4 py-1.5 text-sm font-medium text-[#138ba0] transition-colors hover:bg-[#eef9fb]"
className="mt-3 rounded-full border border-[#138ba0] px-4 py-1.5 text-sm font-medium text-[#0f7183] transition-colors hover:bg-[#eef9fb]"
>
Try again
</button>
@ -171,7 +171,7 @@ export default function AdminPanel() {
return (
<div>
<h1 className="text-2xl font-bold text-[#138ba0]">Panel</h1>
<h1 className="text-2xl font-bold text-[#0f7183]">Panel</h1>
<p className="mt-1 text-[#4a6b72]">
Accounts and server state. Everything here is superadmin-only.
</p>
@ -281,7 +281,7 @@ export default function AdminPanel() {
type="button"
disabled={busy}
onClick={() => revoke(row)}
className="ml-3 text-xs font-medium text-[#138ba0] underline-offset-4 hover:underline disabled:opacity-50"
className="ml-3 text-xs font-medium text-[#0f7183] underline-offset-4 hover:underline disabled:opacity-50"
>
Sign out
</button>
@ -296,7 +296,7 @@ export default function AdminPanel() {
className={`rounded-full border px-3 py-1 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${
row.is_active
? "border-[#4a6b72]/30 text-[#4a6b72] hover:border-[#b3261e]/50 hover:text-[#b3261e]"
: "border-[#138ba0]/40 text-[#138ba0] hover:bg-[#eef9fb]"
: "border-[#138ba0]/40 text-[#0f7183] hover:bg-[#eef9fb]"
}`}
>
{row.is_active ? "Disable" : "Enable"}

View file

@ -356,13 +356,13 @@ export default function EntityEdit() {
<button
type="button"
onClick={() => leave(`/admin/${manifest.key}`)}
className="text-sm text-[#4a6b72] hover:text-[#138ba0]"
className="text-sm text-[#4a6b72] hover:text-[#0f7183]"
>
← {manifest.label}
</button>
)}
<h1 className="mt-2 text-3xl font-bold text-[#138ba0]">
<h1 className="mt-2 text-3xl font-bold text-[#0f7183]">
{isNew ? `New ${manifest.singular}` : heading}
</h1>
@ -478,7 +478,7 @@ export default function EntityEdit() {
type="button"
onClick={save}
disabled={saving || !dirty}
className="rounded-full bg-[#138ba0] px-6 py-2 font-semibold text-white transition-colors hover:bg-[#0f7183] disabled:bg-[#4a6b72]/25"
className="rounded-full bg-[#0f7183] px-6 py-2 font-semibold text-white transition-colors hover:bg-[#0b5c6a] disabled:bg-[#4a6b72]/25"
>
{saving ? "Saving…" : isNew ? "Create" : "Save changes"}
</button>
@ -506,7 +506,7 @@ export default function EntityEdit() {
<span
role="status"
className={`flex items-center gap-2 text-sm ${
message.tone === "ok" ? "text-[#138ba0]" : "text-[#b3261e]"
message.tone === "ok" ? "text-[#0f7183]" : "text-[#b3261e]"
}`}
>
{message.text}

View file

@ -39,6 +39,9 @@ export default function EntityList() {
// well as editors, which is the failure mode an == against a
// ladder always produces once a rank is added above it.
const canWrite = atLeast(user, manifest?.writeRole ?? "editor");
// The cell that carries the row's link: the primary column, else the first.
const columns = manifest?.list.columns ?? [];
const linkKey = (columns.find((c) => c.primary) ?? columns[0])?.key;
const load = useCallback(async () => {
if (!manifest || manifest.singleton) return;
@ -89,11 +92,11 @@ export default function EntityList() {
return (
<div>
<div className="flex flex-wrap items-center gap-4">
<h1 className="text-3xl font-bold text-[#138ba0]">{manifest.label}</h1>
<h1 className="text-3xl font-bold text-[#0f7183]">{manifest.label}</h1>
{canWrite && (
<Link
to={`/admin/${manifest.key}/new`}
className="ml-auto rounded-full bg-[#138ba0] px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-[#0f7183]"
className="ml-auto rounded-full bg-[#0f7183] px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-[#0b5c6a]"
>
New {manifest.singular}
</Link>
@ -162,6 +165,8 @@ export default function EntityList() {
</tr>
</thead>
<tbody>
{/* The row click is for the mouse; the link in the primary
cell is what a keyboard or screen reader uses. */}
{rows.map((row) => (
<tr
key={row.id}
@ -175,11 +180,23 @@ export default function EntityList() {
column.primary ? "font-medium text-[#26454c]" : "text-[#4a6b72]"
}`}
>
{column.widget === "bool"
? row[column.key]
? "Yes"
: "-"
: row[column.key] || "-"}
{column.key === linkKey ? (
<Link
to={`/admin/${manifest.key}/${row.id}`}
onClick={(e) => e.stopPropagation()}
className="hover:underline"
>
{row[column.key] || row.id}
</Link>
) : column.widget === "bool" ? (
row[column.key] ? (
"Yes"
) : (
"-"
)
) : (
row[column.key] || "-"
)}
</td>
))}
<td className="px-4 py-3 font-mono text-xs text-[#4a6b72]">{row.id}</td>

View file

@ -71,13 +71,13 @@ function PostCard({ post, accent }: { post: BlogPostSummary; accent: string }) {
function Subheading({ children, accent }: { children: string; accent: string }) {
return (
<h3 className="text-2xl font-800" style={{ color: accent }}>
<h3 className="text-2xl font-extrabold" style={{ color: accent }}>
{children}
</h3>
)
}
export default function CommunityBlog({ accent = '#138ba0' }: { accent?: string }) {
export default function CommunityBlog({ accent = '#0f7183' }: { accent?: string }) {
const { data: blog, loading, error, reload } = useCommunityBlog()
if (!blog) {

View file

@ -26,7 +26,7 @@
edge and marked as continuing
series every meeting the schedule produces in view (see
eventSeries.ts), one day each, with its time
undated nowhere — there's no day to put it on. Counted
undated nowhere, there's no day to put it on. Counted
under the grid so it doesn't vanish without a word.
Bars are laid out per week in lanes, so a long event keeps its
@ -42,7 +42,7 @@
import { useMemo, useState } from 'react'
import { Link } from 'react-router-dom'
import { typesPresent, useEvents } from '../../data/eventData.ts'
import { typesPresent, useEvents } from '../../lib/eventData.ts'
import { EVENT_TYPES, eventTypeLabel, type EventType } from '../../lib/eventTypes.ts'
import { firstOccurrenceFrom, occurrencesBetween, seriesTimes } from '../../lib/eventSeries.ts'
import { eventHref } from '../../lib/hrefs.ts'
@ -56,7 +56,7 @@ const ALL_CONTROLS: CalendarControl[] = ['scope', 'type', 'online', 'search']
/* Bar rows drawn per week before a day collapses to "+N more". */
const MAX_LANES = 3
const TEAL = '#138ba0'
const TEAL = '#0f7183'
const INK = '#073d4a'
const BODY = '#4a6b72'
@ -398,7 +398,7 @@ export default function EventCalendar({
onChange={(e) => setQuery(e.target.value)}
placeholder="Search events"
aria-label="Search events"
className="min-w-[12rem] flex-1 rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm outline-none focus:border-[#138ba0] md:max-w-xs"
className="min-w-[12rem] flex-1 rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm outline-none focus:border-[#0f7183] focus:ring-2 focus:ring-[#0f7183]/40 md:max-w-xs"
/>
)}
{filtering && (
@ -781,7 +781,7 @@ function FilterSelect({
value={value}
onChange={(e) => onChange(e.target.value)}
aria-label={label}
className="rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm outline-none focus:border-[#138ba0]"
className="rounded-full border border-[#138ba0]/25 bg-white px-4 py-2 text-sm outline-none focus:border-[#0f7183] focus:ring-2 focus:ring-[#0f7183]/40"
>
<option value="">{all}</option>
{options.map(([id, name]) => (

View file

@ -1,6 +1,6 @@
import { useEffect, useMemo, useRef, useState } from "react";
import { Link } from "react-router-dom";
import { splitByStatus, typesPresent, useEvents } from "../../data/eventData.ts";
import { splitByStatus, typesPresent, useEvents } from "../../lib/eventData.ts";
import { eventHref } from "../../lib/hrefs.ts";
import { EVENT_TYPES, eventTypeLabel } from "../../lib/eventTypes.ts";
import { seriesLabel } from "../../lib/eventSeries.ts";
@ -8,7 +8,7 @@ import PlatformIcon from "../../components/PlatformIcon.tsx";
import { eventBackground, eventLogo as eventLogoSrc, orgLogo as orgLogoSrc } from "../../lib/media.ts";
/* ═══════════════════════════════════════════════════════════════
EVENT LIST — CARDS
EVENT LIST: CARDS
A band of event cards, as a peek carousel or a grid. Self
contained: give it a filter and it fetches, so the same section
@ -23,7 +23,7 @@ import { eventBackground, eventLogo as eventLogoSrc, orgLogo as orgLogoSrc } fro
`type` pre-filters the band the way `scope` and `host` do. Left
off, the band takes every kind it finds and grows a row of chips
to narrow by — but only once it holds more than one, so a band of
to narrow by, but only once it holds more than one, so a band of
nothing but retreats shows no control at all.
═══════════════════════════════════════════════════════════════ */
@ -49,7 +49,8 @@ function Logo({ src, alt = "", className }) {
);
}
const TEAL = "#138ba0"; // last-resort card color
const TEAL = "#0f7183"; // last-resort card color
const INK = "#073d4a"; // button text: the card colour is only a border
const CARD_BG = "#ffffff"; // sits under every card, gradient or not
/* Laid over a card's background image so black text reads on any
@ -91,7 +92,7 @@ const PAST_FADE = "linear-gradient(to bottom, black 0%, black 45%, transparent 1
/* ── Carousel sizing ──────────────────────────────────────────
CARD the card itself
GAP space between cards — raise to push neighbors out
GAP space between cards, raise to push neighbors out
FADE_DIST how far past the card's edge neighbors fade to nothing
───────────────────────────────────────────────────────────── */
const CARD = "min(48rem, 90vw)";
@ -113,7 +114,7 @@ const EDGE_FADE = `linear-gradient(to right,
A link on the title rather than a wrapper around the whole card:
the footer already holds anchors, and an anchor inside an anchor
is invalid markup that every browser resolves by guessing. The
carousel has the same constraint — it needs the card's click to
carousel has the same constraint, it needs the card's click to
mean "bring this one to the front" on anything that isn't the
active slide. */
function TitleLink({ ev, linked, children }) {
@ -126,7 +127,7 @@ function TitleLink({ ev, linked, children }) {
}
/* ═══════════════════════════════════════════════════════════════
EVENT CARD — one component, two sizes.
EVENT CARD: one component, two sizes.
compact=false → the full card used in the carousel
compact=true → the grid card: details left, text right, and a
footer pinned to the bottom so every card in a
@ -136,9 +137,9 @@ function TitleLink({ ev, linked, children }) {
page or a home strip can render one without the section around
it.
Fields arrive pre-resolved from the API — `color` is the event's
Fields arrive pre-resolved from the API: `color` is the event's
own or its host's, `status` is derived from the dates when it
isn't set — so nothing here reimplements those rules.
isn't set, so nothing here reimplements those rules.
`linked` is the one thing a caller turns off: a card on the
event's own page shouldn't link to the page it's already on.
@ -165,12 +166,12 @@ export function Card({
/* Off unless the caller says the band is mixed. A "Retreat" badge
on every card in a row of nothing but retreats is noise, and
the card can't tell on its own — it only ever sees one event. */
the card can't tell on its own, it only ever sees one event. */
const typeBadge =
showType && ev.event_type ? (
<span
className="inline-block rounded-full px-3 py-0.5 mb-2 text-xs font-700 uppercase tracking-wide"
style={{ border: `1px solid ${color}`, color }}
className="inline-block rounded-full px-3 py-0.5 mb-2 text-xs font-bold uppercase tracking-wide"
style={{ border: `1px solid ${color}`, color: INK }}
>
{eventTypeLabel(ev.event_type)}
</span>
@ -200,6 +201,9 @@ export function Card({
filter: past ? "saturate(0.75)" : "none",
pointerEvents: interactive ? "auto" : "none",
}}
// A card shown but not in play (a carousel neighbour, a collapsed
// past event) keeps its links out of the tab order too.
inert={!interactive}
>
<div className={`flex-1 flex flex-col ${compact ? "p-8" : "p-10"}`}>
{compact ? (
@ -208,13 +212,13 @@ export function Card({
<Logo src={orgLogo} className="ev-ngu h-11 w-auto mb-4" />
<div className="ev-info">
{typeBadge}
<h3 className="text-3xl font-900 leading-tight">
<h3 className="text-3xl font-extrabold leading-tight">
<TitleLink ev={ev} linked={linked}>
{ev.title}
</TitleLink>
</h3>
{ev.theme && (
<p className="text-xl font-300 font-bold">"{ev.theme}"</p>
<p className="text-xl font-normal font-bold">"{ev.theme}"</p>
)}
{ev.date_label && <p className="text-xl">{ev.date_label}</p>}
{schedule && <p className="text-xl">{schedule}</p>}
@ -224,7 +228,7 @@ export function Card({
</div>
<Logo
src={eventLogo}
alt={ev.title}
alt=""
className="ev-image w-full h-auto object-contain"
/>
<div className="ev-desc">{descriptions}</div>
@ -236,13 +240,13 @@ export function Card({
<div className="md:col-span-2">
<Logo src={orgLogo} className="h-15 w-auto mb-6" />
{typeBadge}
<h3 className="text-4xl font-900">
<h3 className="text-4xl font-extrabold">
<TitleLink ev={ev} linked={linked}>
{ev.title}
</TitleLink>
</h3>
{ev.theme && (
<p className="text-2xl font-300 font-bold">"{ev.theme}"</p>
<p className="text-2xl font-normal font-bold">"{ev.theme}"</p>
)}
{ev.date_label && <p className="text-2xl">{ev.date_label}</p>}
{schedule && <p className="text-2xl">{schedule}</p>}
@ -253,7 +257,7 @@ export function Card({
<div className="md:col-span-1 flex items-center justify-end">
<Logo
src={eventLogo}
alt={ev.title}
alt=""
className="w-full h-auto max-h-72 object-contain"
/>
</div>
@ -262,19 +266,19 @@ export function Card({
</>
)}
{/* Footer — mt-auto pins the whole block to the bottom so
{/* Footer, mt-auto pins the whole block to the bottom so
buttons line up across every card in a grid row.
Three registration states, as before: links to follow, a
past event, or an announcement still to come. What's new
is that all three end in the same row, because every
event now has a page and a past one is often the more
worth reading — speakers, awards, what actually
worth reading, speakers, awards, what actually
happened. The notice is what changes; the way in
doesn't. */}
<div className={`mt-auto ${compact ? "pt-6" : "pt-8"}`}>
{links.length === 0 && (
<p className="text-center font-600" style={{ color: accent }}>
<p className="text-center font-semibold" style={{ color: accent }}>
{past
? "This event has concluded. Thank you to everyone who joined us!"
: igHandle
@ -295,10 +299,10 @@ export function Card({
<a
key={item.label}
href={item.url}
className={`inline-flex items-center justify-center gap-2 rounded-xl font-700 transition-all duration-200 hover:scale-105 text-center ${
className={`inline-flex items-center justify-center gap-2 rounded-xl font-bold transition-all duration-200 hover:scale-105 text-center ${
compact ? "py-2.5 px-5" : "py-2.5 px-6"
}`}
style={{ border: `1px solid ${color}`, color }}
style={{ border: `1px solid ${color}`, color: INK }}
>
<PlatformIcon platform={item.platform} />
{item.label}
@ -306,14 +310,14 @@ export function Card({
))}
{/* Only when there's nothing to register for and the
event hasn't happened — the same condition as before,
event hasn't happened, the same condition as before,
just no longer nested inside that branch. */}
{igHandle && !past && links.length === 0 && (
<a
href={igUrl}
target="_blank"
rel="noopener noreferrer"
className={`ig-link flex items-center justify-center rounded-xl font-700 transition-all duration-200 hover:scale-[1.02] gap-3 ${
className={`ig-link flex items-center justify-center rounded-xl font-bold transition-all duration-200 hover:scale-[1.02] gap-3 ${
compact ? "py-2.5 px-5" : "py-3 px-6"
}`}
style={{ border: `1px solid ${accent}`, color: accent }}
@ -327,10 +331,10 @@ export function Card({
{linked && (
<Link
to={eventHref(ev.id)}
className={`rounded-xl font-700 transition-all duration-200 hover:scale-105 text-center ${
className={`rounded-xl font-bold transition-all duration-200 hover:scale-105 text-center ${
compact ? "py-2.5 px-5" : "py-2.5 px-6"
}`}
style={{ border: `1px solid ${color}`, color }}
style={{ border: `1px solid ${color}`, color: INK }}
>
Event details
</Link>
@ -346,7 +350,7 @@ export function Card({
TYPE FILTER
Drawn only when a band actually holds more than one kind, so it
costs nothing today — every event is a retreat — and appears on
costs nothing today, every event is a retreat, and appears on
its own the first time a class or a workshop lands in that band.
Nothing on Retreats.tsx has to be reconfigured for it.
@ -366,7 +370,7 @@ export function TypeFilter({ types, active, setActive, accent }) {
key={id}
onClick={() => setActive(id)}
aria-pressed={active === id}
className="rounded-full py-1.5 px-4 text-sm font-700 transition-colors duration-200"
className="rounded-full py-1.5 px-4 text-sm font-bold transition-colors duration-200"
style={chip(active === id)}
>
{label}
@ -387,7 +391,7 @@ export function TypeFilter({ types, active, setActive, accent }) {
}
/* ═══════════════════════════════════════════════════════════════
TOGGLE — the control for the section heading's action bar
TOGGLE: the control for the section heading's action bar
═══════════════════════════════════════════════════════════════ */
export function EventCardsToggle({ view, setView, accent }) {
const btn = active => ({
@ -405,7 +409,7 @@ export function EventCardsToggle({ view, setView, accent }) {
<button
onClick={() => setView("carousel")}
aria-pressed={view === "carousel"}
className="flex items-center gap-2 py-2 px-4 font-700 text-sm transition-colors duration-200"
className="flex items-center gap-2 py-2 px-4 font-bold text-sm transition-colors duration-200"
style={btn(view === "carousel")}
>
<svg viewBox="0 0 24 24" className="h-4 w-4" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
@ -417,7 +421,7 @@ export function EventCardsToggle({ view, setView, accent }) {
<button
onClick={() => setView("grid")}
aria-pressed={view === "grid"}
className="flex items-center gap-2 py-2 px-4 font-700 text-sm transition-colors duration-200"
className="flex items-center gap-2 py-2 px-4 font-bold text-sm transition-colors duration-200"
style={btn(view === "grid")}
>
<svg viewBox="0 0 24 24" className="h-4 w-4" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
@ -437,8 +441,8 @@ export function EventCardsToggle({ view, setView, accent }) {
Fetches its own slice of the events, then draws it as a carousel
or a grid.
An empty list means three different things now — still loading,
failed, or genuinely nothing scheduled — and they read very
An empty list means three different things now, still loading,
failed, or genuinely nothing scheduled, and they read very
differently to someone waiting, so they're distinguished rather
than all falling through to "coming soon".
═══════════════════════════════════════════════════════════════ */
@ -464,7 +468,7 @@ export default function EventListCards({
const [showPast, setShowPast] = useState(false);
const [activeType, setActiveType] = useState("all");
/* What this band holds, which is what the chips offer — not the
/* What this band holds, which is what the chips offer, not the
full list of declared types, three quarters of which would be
dead buttons. */
const availableTypes = useMemo(
@ -483,7 +487,7 @@ export default function EventListCards({
);
/* Open on the first upcoming event. The list is empty on the
first render, so this can't be a useState initialiser — it has
first render, so this can't be a useState initialiser, it has
to wait for the data and then run once. Clearing the guard when
the list empties means a refetch re-seeds. */
const seeded = useRef(false);
@ -525,7 +529,7 @@ export default function EventListCards({
});
const notice = text => (
<p className="max-w-6xl mx-auto px-6 font-600" style={{ color: accent }}>
<p className="max-w-6xl mx-auto px-6 font-semibold" style={{ color: accent }}>
{text}
</p>
);
@ -546,7 +550,7 @@ export default function EventListCards({
if (error && events.length === 0) {
return (
<div className="overflow-hidden">
{notice("· Events couldn't be loaded just now — please try again shortly ·")}
{notice("· Events couldn't be loaded just now, please try again shortly ·")}
</div>
);
}
@ -572,7 +576,7 @@ export default function EventListCards({
: `· No ${eventTypeLabel(activeType).toLowerCase()} events in this section yet ·`,
)
) : view === "grid" ? (
/* ── GRID VIEW — upcoming first, past events collapsed below ── */
/* ── GRID VIEW: upcoming first, past events collapsed below ── */
<div className="mx-auto px-8 md:px-12 lg:px-16" style={{ maxWidth: GRID_MAX }}>
{upcoming.length > 0 && (
<div
@ -595,7 +599,7 @@ export default function EventListCards({
{pastEvents.length > 0 && (
<div className="mt-12">
<h3
className="text-2xl font-800 mb-6"
className="text-2xl font-extrabold mb-6"
style={{ color: accent, opacity: 0.85 }}
>
Past Events
@ -635,7 +639,7 @@ export default function EventListCards({
<button
onClick={() => setShowPast(v => !v)}
aria-expanded={showPast}
className="flex items-center gap-2 py-2.5 px-6 rounded-xl font-700 transition-all duration-200 hover:scale-105"
className="flex items-center gap-2 py-2.5 px-6 rounded-xl font-bold transition-all duration-200 hover:scale-105"
style={{ border: `1px solid ${accent}`, color: accent }}
>
{showPast
@ -704,7 +708,7 @@ export default function EventListCards({
onClick={prev}
disabled={index === 0}
aria-label="Previous event"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 rounded-full flex items-center justify-center text-2xl font-700 shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
className="absolute left-2 md:left-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 rounded-full flex items-center justify-center text-2xl font-bold shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index > 0)}
>
‹
@ -713,7 +717,7 @@ export default function EventListCards({
onClick={next}
disabled={index === events.length - 1}
aria-label="Next event"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 rounded-full flex items-center justify-center text-2xl font-700 shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
className="absolute right-2 md:right-6 top-1/2 -translate-y-1/2 z-10 h-12 w-12 rounded-full flex items-center justify-center text-2xl font-bold shadow-lg transition-all duration-200 hover:scale-110 disabled:hover:scale-100"
style={arrowStyle(index < events.length - 1)}
>
›
@ -729,6 +733,7 @@ export default function EventListCards({
key={e.id}
onClick={() => setIndex(i)}
aria-label={`Go to ${e.title}`}
aria-current={i === index ? "true" : undefined}
className="h-2.5 rounded-full transition-all duration-200"
style={{
width: i === index ? "1.5rem" : "0.625rem",

View file

@ -16,7 +16,7 @@ import { post, ApiError } from "../../lib/api.ts";
import { PAGE_LINKS, PAGE_SECTIONS } from "../../navConfig.ts";
import { FEEDBACK_TYPES } from "../../data/feedbackTypes.ts";
const ACCENT = "#138ba0";
const ACCENT = "#0f7183";
const MUTED = "#4a6b72";
const MAX_CHARS = 1500;
const MIN_MESSAGE = 10; // matches the server
@ -40,7 +40,7 @@ const selectClass = `${fieldClass} appearance-none pr-10`;
function OptionalTag() {
return (
<span className="ml-2 rounded-full bg-[#eef9fb] px-2 py-0.5 text-xs font-medium text-[#138ba0]">
<span className="ml-2 rounded-full bg-[#eef9fb] px-2 py-0.5 text-xs font-medium text-[#0f7183]">
Optional
</span>
);
@ -132,7 +132,7 @@ function TypePicker({ value, onChange }) {
className={
"mt-0.5 h-4 w-4 shrink-0 rounded-full border-2 transition-colors " +
(selected
? "border-[#138ba0] bg-[#138ba0] ring-2 ring-inset ring-white"
? "border-[#138ba0] bg-[#0f7183] ring-2 ring-inset ring-white"
: "border-[#4a6b72]/30")
}
/>
@ -291,7 +291,7 @@ export default function FeedbackForm() {
className="rounded-2xl border border-[#138ba0]/20 bg-white p-8 sm:p-10"
>
<h3 className="text-2xl font-bold" style={{ color: ACCENT }}>
Thanks — we've got it
Thanks, we've got it
</h3>
{where && (
<p className="mt-3 text-sm" style={{ color: MUTED }}>
@ -301,12 +301,12 @@ export default function FeedbackForm() {
<p className="mt-3 max-w-prose" style={{ color: MUTED }}>
{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."}
: "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
</p>
<button
type="button"
onClick={reset}
className="mt-6 rounded-full border border-[#138ba0] px-5 py-2.5 font-semibold text-[#138ba0] 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
</button>
@ -375,7 +375,7 @@ export default function FeedbackForm() {
</div>
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
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.
them in only if you'd like a reply, we won't add you to any list.
</p>
<div className="mt-5 grid gap-4 sm:grid-cols-2">
@ -447,7 +447,7 @@ export default function FeedbackForm() {
<button
type="submit"
disabled={!ready || sending}
className="rounded-full bg-[#138ba0] px-7 py-3 font-semibold text-white transition-colors hover:bg-[#0f7183] 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"}
</button>

Some files were not shown because too many files have changed in this diff Show more