Tidy the structure the audit found

- The colour defaults have one source, server/src/themeDefaults.js,
  read by the server and the admin; the build stops if src/index.css
  disagrees with it
- server/src/admin-schema.js split into admin-schema/, one file per
  entity plus columns.js (the registry checked identical)
- loadOwned() in shape.js replaces the same three loads on four
  detail routes (every public route checked identical); one NO_STORE
- One OrgLogo component for the org lists and the chapter map; an
  organization's own page now shows the same initials as the lists
- One localISO() for the viewer's calendar day, in place of three
- Boot refuses a descriptor dropdown value the table's CHECK doesn't
  allow, instead of it failing on save
- Deleted the unused Other.tsx and white-background logo;
  chapters.ts is useCommunity.ts; isSuper() in the Panel; stale
  comments and docs corrected

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-29 03:02:21 -05:00
parent 048c7599ce
commit f934b1dd93
44 changed files with 1187 additions and 1170 deletions

View file

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="403.64276mm"
height="86.755943mm"
viewBox="0 0 403.64273 86.755943"
version="1.1"
id="svg5"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2" />
<g
id="layer10"
style="display:inline"
transform="translate(-344.28592,167.60401)">
<g
id="g3">
<circle
style="display:inline;fill:#008da9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.634488;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path205602-8-3-1"
cx="403.82111"
cy="-121.75806"
r="40.889923" />
<path
id="path1887-1-3-7-7-6-2"
style="color:#000000;display:inline;fill:#008da9;fill-opacity:1;stroke:none;stroke-width:2.284;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 443.45159,-167.57122 c -8.63995,3.71591 -17.05927,7.97953 -25.85742,11.27148 -3.76442,1.391 -7.68514,2.52606 -11.12305,4.64648 -3.58916,2.42042 -5.95825,6.25942 -7.35135,10.29228 -1.23335,3.0863 -2.32136,6.17712 -3.84982,9.11983 -3.67393,-2.17848 -7.69746,-4.08371 -12.04108,-4.24843 -4.09333,-0.39358 -8.26381,0.55262 -11.85512,2.53592 -6.41916,3.13465 -11.92468,7.82515 -18.56868,10.51862 -2.73797,1.21486 -5.51687,2.3331 -8.27926,3.49077 -0.88252,2.47734 0.77854,5.31191 3.20508,6.10351 4.27199,1.7128 8.98018,1.56772 13.49433,1.35771 4.71612,-0.31488 9.32779,-1.47771 13.7933,-2.98449 4.28568,-1.20657 8.61172,-2.23873 13.00143,-3.03728 -2.64145,2.85774 -6.27041,4.39222 -9.272,6.78523 -0.9862,0.76271 -1.85771,1.89939 -1.64657,3.21845 0.1709,1.85512 1.7211,3.08775 2.9593,4.29677 2.6421,2.35246 5.95831,4.07918 9.49722,4.487017 1.35103,0.106385 2.71085,-0.642417 3.25697,-1.900747 1.43582,-2.68121 2.25426,-5.67671 4.35603,-7.93655 1.20099,-1.4152 3.08751,-1.77888 4.83141,-2.01081 3.79664,-0.62592 7.50391,-2.47133 9.93534,-5.50938 1.37471,-1.65305 2.10201,-3.71602 2.52235,-5.79656 0.1379,-0.6722 1.04486,-0.68506 1.58622,-0.85974 1.78218,-0.35339 3.91283,-0.77776 4.83392,-2.54366 0.89776,-1.84635 -0.0715,-4.04503 -1.61189,-5.21854 -2.41639,-1.86664 -5.65021,-3.01579 -8.63111,-2.61499 2.2258,-1.54005 4.74178,-2.58917 7.19752,-3.70372 6.31792,-2.71081 13.11161,-4.94567 18.40937,-9.54069 3.73885,-3.20962 6.79577,-7.24801 8.78271,-11.76096 0.80138,-2.0522 1.44232,-4.33553 0.95805,-6.5376 -0.3398,-1.04637 -1.34059,-2.15906 -2.5332,-1.91992 z" />
<path
id="path92116-3-2-7-1-4"
style="display:inline;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.222835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 401.4397,-85.357733 -5.07733,3.7999 c 1.40469,0.28813 3.37038,0.49431 4.1477,0.56482 0,0 13.4726,-8.14749 21.27399,-14.00284 7.80139,-5.855347 13.28514,-13.045137 15.64699,-18.030857 4.23462,-8.93904 5.76755,-17.18121 4.93866,-21.94278 -2.3532,12.13055 -6.84548,20.1394 -8.91525,22.66728 -2.77658,3.39114 -7.3818,10.79482 -14.1263,15.035397 -8.02485,5.04559 -16.87157,10.25674 -17.88846,11.90908 z" />
<path
fill="#519259"
d="m 401.25566,-85.224563 c 2.11431,-7.90893 7.29014,-19.728807 13.53049,-25.077287 3.15174,-2.74769 6.75532,-5.34691 11.45401,-7.64618 4.36158,-2.05194 6.70709,-3.73973 9.19688,-6.81027 3.40267,-3.94053 5.90574,-7.35199 6.96383,-10.47421 0.22347,8.84634 -6.48806,19.37766 -9.02864,23.54668 -6.2265,9.41606 -10.0147,12.608287 -17.50625,17.196147 -4.38236,2.60687 -9.65678,5.68615 -14.61032,9.26512 z"
fill-opacity="1"
fill-rule="nonzero"
id="path184-6-7-6-9-3-2"
style="display:inline;fill:#358a0d;fill-opacity:1;stroke:none;stroke-width:0.625031;stroke-opacity:1" />
<path
style="color:#000000;display:inline;fill:#ffffff;stroke:none;stroke-width:2.284;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 358.52422,-123.11955 c 3.13369,-1.59928 7.04147,-4.49077 10.29591,-6.33595 3.25443,-1.84519 6.30899,-3.58417 9.61426,-4.20523 2.65302,-0.4889 6.37319,-0.18817 9.07211,0.58357 2.69896,0.77175 5.57299,2.70484 7.16593,3.40762 1.59295,0.70275 2.24655,0.19006 2.82855,-0.77494 0.582,-0.96504 2.81839,-6.05064 3.84362,-8.9293 1.02519,-2.87864 2.26409,-5.72337 4.14553,-7.76121 1.88144,-2.03782 2.31893,-2.07776 4.06202,-3.15865 1.74307,-1.08086 10.24244,-3.71628 14.53403,-5.61581 4.29158,-1.89953 8.11957,-3.58996 12.24067,-5.48028 4.12109,-1.89033 6.08861,-2.79441 7.30709,-3.29554 0.273,0.73801 -0.2034,3.06663 -1.16031,5.22317 -0.95691,2.15654 -2.9569,5.04357 -4.86279,7.26365 -1.90589,2.22009 -4.28775,4.10342 -6.82223,5.66812 -2.53448,1.56467 -4.53981,2.45823 -7.60439,3.71266 -3.06457,1.25446 -11.88915,4.7102 -14.64698,7.12005 -2.75786,2.40984 -4.18313,6.63212 -3.64772,7.60115 0.5354,0.96902 2.51391,-1.48598 3.81084,-2.34867 1.29694,-0.8627 1.95172,-1.05814 3.14897,-1.09198 1.17765,-0.0172 2.77532,0.40067 3.29849,0.63293 1.48441,0.659 3.97438,2.00122 3.54176,3.36038 -0.16368,0.51434 -0.19462,0.56904 -3.05611,1.25841 -2.86151,0.68935 -3.48508,1.29579 -3.81533,3.74861 -0.22097,1.47094 -1.44719,3.88743 -3.13317,5.28015 -1.68596,1.39274 -4.55099,2.93627 -8.41717,3.35482 -3.86617,0.41855 -6.17544,3.97192 -6.93256,5.37259 -0.75713,1.40064 -2.66104,5.90506 -2.99685,6.15238 -0.3358,0.24732 -2.76998,-0.36582 -3.79458,-0.82517 -1.02463,-0.45935 -2.612,-1.39111 -3.63624,-2.16132 -1.02425,-0.7702 -3.457,-2.975 -3.0018,-3.64018 0.45519,-0.66516 1.56543,-1.35445 2.73515,-2.12254 1.16972,-0.76811 3.86984,-2.33631 5.3456,-3.59002 1.47576,-1.25372 2.7334,-2.47754 3.4042,-3.48323 0.67079,-1.00567 0.9358,-2.14286 -0.28206,-2.7388 -1.21786,-0.59597 -1.84092,-0.39835 -4.4486,0.0225 -2.60769,0.42097 -4.8218,1.10142 -8.46858,1.9005 -3.64678,0.79905 -7.82786,2.49393 -10.97221,3.07304 -3.14439,0.5791 -4.3363,0.83756 -8.5197,0.95691 -4.1834,0.11935 -7.15938,-0.35864 -8.95468,-0.91763 -1.7953,-0.55899 -2.64147,-1.55556 -2.60415,-2.17667 3.90737,-1.58574 7.9469,-3.2841 11.38348,-5.04009 z"
id="path1887-1-3-7-7-6" />
<path
fill="#519259"
d="m 412.95849,-81.884143 c 4.58067,-1.05723 7.7275,-1.9948 13.67931,-5.91343 5.95181,-3.91863 10.62995,-9.54813 13.02992,-14.097387 2.39997,-4.54926 4.34384,-10.28218 4.83384,-15.81643 0.49,-5.53425 0.14775,-11.25197 -2.10696,-17.66367 0.15927,9.10203 -2.7414,15.06092 -4.17879,18.80503 -1.43739,3.74411 -4.80196,9.50687 -8.2717,13.57264 -3.46184,4.223207 -7.82036,7.647487 -12.67981,10.383567 -5.38026,3.05578 -13.21504,8.4585 -16.7484,11.61577 4.01135,0.4226 9.12694,-0.10316 12.44259,-0.88609 z"
fill-opacity="1"
fill-rule="nonzero"
id="path182-2-6-6-7-2-2"
style="display:inline;fill:#358a0d;fill-opacity:1;stroke:none;stroke-width:0.717458;stroke-opacity:1" />
</g>
<g
id="g40616-9"
transform="translate(13.096206,-216.39844)"
style="display:inline">
<g
id="g2-4">
<text
xml:space="preserve"
style="font-size:34.109px;line-height:1.25;font-family:Impact;-inkscape-font-specification:Impact;letter-spacing:0px;word-spacing:0px;display:inline;stroke-width:0.852729"
x="451.59149"
y="89.758339"
id="text156858-3-8"><tspan
id="tspan156856-8-82"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:34.109px;font-family:Poppins;-inkscape-font-specification:'Poppins, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#008da9;fill-opacity:1;stroke-width:0.852729"
x="451.59149"
y="89.758339">Next Generation</tspan></text>
<text
xml:space="preserve"
style="font-size:33.8136px;line-height:1.25;font-family:Impact;-inkscape-font-specification:Impact;letter-spacing:0px;word-spacing:0px;display:inline;stroke-width:0.845345"
x="469.26224"
y="119.08144"
id="text156858-3-1-4"><tspan
id="tspan156856-8-8-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:33.8136px;font-family:Poppins;-inkscape-font-specification:'Poppins, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#008da9;fill-opacity:1;stroke-width:0.845345"
x="469.26224"
y="119.08144">of Unity</tspan></text>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.4 KiB

View file

@ -0,0 +1,39 @@
/* ═══════════════════════════════════════════════════════════════
ORG LOGO
An organization's logo, or its initials in a square in its colour
when there's no file or it fails to load. Decorative: the name is
always right beside it. Used by the organization lists and the
chapter map.
═══════════════════════════════════════════════════════════════ */
import Logo from './Logo.tsx'
import { accentText } from '../lib/color.ts'
import { mediaUrl } from '../lib/media.ts'
import { initialsFor } from '../lib/organizations.ts'
export default function OrgLogo({
org,
color,
size = 'h-14 w-14',
}: {
org: { logo?: string | null; name: string }
color: string
size?: string
}) {
return (
<Logo
src={mediaUrl(org.logo)}
className={`${size} object-contain rounded-xl shrink-0`}
fallback={
<span
className={`${size} rounded-xl shrink-0 flex items-center justify-center font-extrabold`}
style={{ border: `1px solid ${color}`, color: accentText(color) }}
aria-hidden="true"
>
{initialsFor(org.name)}
</span>
}
/>
)
}

View file

@ -3,9 +3,8 @@
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
the server isn't in this workspace, and it's the thing that
decides what's storable.
server/src/routes/feedback.js, which decides what's storable;
keep the two in step.
DATA_REQUEST is kept out of the tiles: the Privacy page's form
sends it (FeedbackForm's fixedType), with an email required.

View file

@ -1,5 +1,6 @@
import siteConfiguration from "../../../site.json";
import { mediaUrl } from "../media.ts";
import { THEME_DEFAULTS } from "../../../server/src/themeDefaults.js";
/* ── Site settings (035_site_settings.sql) ───────────────────────
Overrides for site.json, superadmins only: every blank falls back
@ -8,24 +9,32 @@ const SITE_PAGES: [string, string][] = Object.entries(siteConfiguration.pages).m
([path, page]) => [path, `${page.title} (${path})`],
);
/* The palette an admin can change: token, label, light default, dark
default. Keep in step with THEME_DEFAULTS in server/src/theme.js
and the tokens in src/index.css. */
const THEME_COLORS: [string, string, string, string][] = [
["ink", "Headings", "#073d4a", "#eaf6f8"],
["body", "Body text", "#26454c", "#cde0e4"],
["muted", "Secondary text and quiet borders", "#4a6b72", "#9fb9bf"],
["link", "Links and teal text", "#0f7183", "#5ccbdc"],
["brand", "Brand teal (borders, rules, rings)", "#138ba0", "#2aa7bc"],
["action", "Buttons (under white text)", "#0f7183", "#0f7183"],
["action-hover", "Buttons, hovered", "#0b5c6a", "#0b5c6a"],
["surface", "Page and card background", "#ffffff", "#0c1d21"],
["tint", "Tinted sections and panels", "#eef9fb", "#11292e"],
["tint-soft", "Faint panels and hovered rows", "#f6fbfc", "#0f2428"],
["danger", "Errors and warnings", "#b3261e", "#ff8a80"],
["danger-tint", "Error panel background", "#fdf3f2", "#3b1714"],
/* The palette an admin can change, in the order the dropdown lists
it: token and label. The defaults come from the server's list
(server/src/themeDefaults.js), which the build checks against
src/index.css, so there's one copy of each colour to change. */
const THEME_LABELS: [string, string][] = [
["ink", "Headings"],
["body", "Body text"],
["muted", "Secondary text and quiet borders"],
["link", "Links and teal text"],
["brand", "Brand teal (borders, rules, rings)"],
["action", "Buttons (under white text)"],
["action-hover", "Buttons, hovered"],
["surface", "Page and card background"],
["tint", "Tinted sections and panels"],
["tint-soft", "Faint panels and hovered rows"],
["danger", "Errors and warnings"],
["danger-tint", "Error panel background"],
];
const THEME_COLORS: [string, string, string, string][] = THEME_LABELS.map(([token, label]) => [
token,
label,
THEME_DEFAULTS[token][0],
THEME_DEFAULTS[token][1],
]);
const defaultHelp = (row, column: 2 | 3) => {
const entry = THEME_COLORS.find(([token]) => token === row?.token);
return entry ? `Default: ${entry[column]}` : undefined;

View file

@ -17,6 +17,8 @@
not instants, nothing here converts timezones.
═══════════════════════════════════════════════════════════════ */
import { localISO } from './timeline.ts'
export type SeriesFrequency = 'weekly' | 'monthly_date' | 'monthly_weekday'
export type SeriesWeekday = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'
@ -66,11 +68,7 @@ function parseDate(value?: string | null): Date | null {
const isoDate = (date: Date) => date.toISOString().slice(0, 10)
/* The viewer's today, as a calendar date. */
function today(): string {
const now = new Date()
const pad = (n: number) => String(n).padStart(2, '0')
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`
}
const today = (): string => localISO()
const daysInMonth = (year: number, month: number) =>
new Date(Date.UTC(year, month + 1, 0)).getUTCDate()

View file

@ -27,7 +27,7 @@
Now the id is checked here. In dev that's a console.error with a
stack trace pointing at the caller; in production the path still
comes out, because a broken link beats a crashed page, and
useResource refuses to fetch it.
detailPath() returns null for it, so useRecord never fetches it.
═══════════════════════════════════════════════════════════════ */
export type OrgKind = 'national' | 'region' | 'chapter' | 'partner'

View file

@ -72,10 +72,11 @@ export function areasSentence(areas: any[] = []) {
.join(", ");
}
/* Initials for a card with no logo. "NGU Lynnwood" → "NL", dropping
the org prefix so every card doesn't read "NG". */
// Alphabetical by name, for sorting organizations.
export const byName = (a, b) => a.name.localeCompare(b.name);
/* Initials for an organization with no logo. "NGU Lynnwood" → "NL",
dropping the org prefix so every card doesn't read "NG". */
export function initialsFor(name = "") {
return name
.replace(/^NGU\s+/i, "")

View file

@ -185,8 +185,11 @@ export function windowStart(item: TimelineItem): string {
return `${year}-${pad(month ?? 1)}-${pad(day ?? 1)}`
}
export function todayISO(now: Date = new Date()): string {
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`
/** A date as the viewer's own calendar day, YYYY-MM-DD (today when
* given nothing). Local, not UTC: after 5pm in California, UTC is
* already tomorrow. The site's one copy of this. */
export function localISO(date: Date = new Date()): string {
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`
}
/**
@ -197,7 +200,7 @@ export function partitionByDate(
items: TimelineItem[],
now: Date = new Date(),
): { upcoming: TimelineItem[]; past: TimelineItem[] } {
const today = todayISO(now)
const today = localISO(now)
const upcoming: TimelineItem[] = []
const past: TimelineItem[] = []
for (const item of items) {

View file

@ -1,13 +1,10 @@
/* ═══════════════════════════════════════════════════════════════
LOCAL CHAPTER DATA
useCommunity
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
per tile, chapters grouped by region.
Its return shape is unchanged from the version that called
/regions and /chapters, so LocalChapters didn't have to move.
The chapter map's view of the organization list (OrgList-Map).
Regions and chapters are the same table and the same endpoint;
this hook reshapes them into what a map needs, slices per tile,
counts per tile, chapters grouped by region.
Two things live elsewhere:

View file

@ -1,7 +1,7 @@
/**
* The four detail endpoints, typed.
* The detail endpoints, typed.
*
* Adding a fifth is a type and a one-line hook, useRecord owns
* Adding one 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

View file

@ -11,8 +11,8 @@
*
* Every detail route in content.js answers the same shape: 200 with
* a single top-level key, or 404 with `{ error }`. So the hook takes
* the path and the key, and the four callers in useContent.ts are
* one line each rather than four copies of this file.
* the path and the key, and each caller (useContent.ts, useHistory,
* useBlog) is one line rather than a copy of this file.
*
* `key` is a string rather than a selector function on purpose. A
* selector passed inline would be a new identity every render, and

View file

@ -30,7 +30,8 @@ import {
type OrganizationRecord,
} from '../lib/useContent.ts'
import { orgHref, orgListHref, teamHref } from '../lib/hrefs.ts'
import { initials, mediaUrl } from '../lib/media.ts'
import { mediaUrl } from '../lib/media.ts'
import { initialsFor } from '../lib/organizations.ts'
import Logo from '../components/Logo.tsx'
import { withAlpha, accentText, readableOn, BRAND } from '../lib/color.ts'
@ -370,7 +371,7 @@ function ChapterMark({ file, name, accent }: { file?: string | null; name: strin
className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-xs font-bold"
style={{ background: accent, color: readableOn(accent) }}
>
{initials(name)}
{initialsFor(name)}
</span>
}
/>

View file

@ -1,13 +0,0 @@
export default function Other() {
return (
<>
<section id="sectiona" className="scroll-mt-28 px-6 py-20">
<h1 className="text-4xl font-bold">Section A</h1>
</section>
<section id="sectionb" className="scroll-mt-28 px-6 py-20">
<h2 className="text-4xl font-bold">Section B</h2>
</section>
</>
);
}

View file

@ -28,7 +28,7 @@ import { useCallback, useEffect, useState } from "react";
import { del, get, patch } from "../../lib/api.ts";
import { isUnauthorized, useAuth } from "../../lib/auth.tsx";
import { useNavigate } from "react-router-dom";
import { ROLES, ROLE_LABELS, ROLE_NOTES } from "../../lib/roles.ts";
import { ROLES, ROLE_LABELS, ROLE_NOTES, isSuper } from "../../lib/roles.ts";
/* SQLite hands back "2026-09-22 04:11:07": UTC, but without the
marker that says so. Left alone, browsers read it as local time
@ -166,7 +166,7 @@ export default function AdminPanel() {
const { system, content, users } = data;
const activeSupers = users.filter(
(u) => u.role === "superadmin" && u.is_active === 1,
(u) => isSuper(u) && u.is_active === 1,
).length;
return (
@ -225,7 +225,7 @@ export default function AdminPanel() {
{users.map((row) => {
const isMe = row.id === me?.id;
const lastSuper =
row.role === "superadmin" && row.is_active === 1 && activeSupers <= 1;
isSuper(row) && row.is_active === 1 && activeSupers <= 1;
const locked = isMe || lastSuper;
const busy = busyId === row.id;

View file

@ -49,6 +49,7 @@ import { firstOccurrenceFrom, occurrencesBetween, seriesTimes } from '../../lib/
import { eventHref } from '../../lib/hrefs.ts'
import type { EventListItem } from '../../lib/useContent.ts'
import { withAlpha, accentText, readableOn, BRAND } from '../../lib/color.ts'
import { localISO } from '../../lib/timeline.ts'
export type CalendarControl = 'scope' | 'type' | 'online' | 'search'
export type CalendarView = 'month' | 'list'
@ -94,8 +95,7 @@ type Segment = Occurrence & {
/* ── Dates ───────────────────────────────────────────────────── */
const pad = (n: number) => String(n).padStart(2, '0')
const iso = (d: Date) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
const iso = (d: Date) => localISO(d)
function parse(date: string): Date {
const [y, m, d] = date.split('-').map(Number)

View file

@ -1,9 +1,7 @@
import { ArrowUpRight } from '@phosphor-icons/react';
import ArrowLink from "../../components/ArrowLink.tsx";
import { mediaUrl } from "../../lib/media.ts";
import Logo from "../../components/Logo.tsx";
import OrgLogo from "../../components/OrgLogo.tsx";
import {
initialsFor,
orgPath,
useOrganizations,
byName,
@ -35,24 +33,6 @@ const FALLBACK_COLOR = "#4a6b72";
const CARD_MIN = "20rem";
const GRID_MAX = "88rem";
function OrgMark({ org, color }) {
return (
<Logo
src={mediaUrl(org.logo)}
className="h-14 w-14 object-contain rounded-xl shrink-0"
fallback={
<span
className="h-14 w-14 rounded-xl shrink-0 flex items-center justify-center font-extrabold"
style={{ border: `1px solid ${color}`, color: accentText(color) }}
aria-hidden="true"
>
{initialsFor(org.name)}
</span>
}
/>
);
}
function OrgCard({ org, accent, pageLabel, siteLabel }) {
const color = org.color || accent;
const path = orgPath(org);
@ -68,7 +48,7 @@ function OrgCard({ org, accent, pageLabel, siteLabel }) {
style={{ border: `1px solid ${color}`, background: "var(--color-surface)" }}
>
<div className="flex items-start gap-4">
<OrgMark org={org} color={color} />
<OrgLogo org={org} color={color} />
<div className="min-w-0 flex-1">
<h3 className="text-xl font-extrabold leading-tight" style={{ color }}>

View file

@ -1,11 +1,10 @@
import { CaretRight, X } from '@phosphor-icons/react';
import { useEffect, useRef, useState } from "react";
import { useCommunity } from "../../lib/chapters.ts";
import { useCommunity } from "../../lib/useCommunity.ts";
import { Link } from "react-router-dom";
import ArrowLink from "../../components/ArrowLink.tsx";
import { mediaUrl } from "../../lib/media.ts";
import Logo from "../../components/Logo.tsx";
import { initialsFor, orgPath } from "../../lib/organizations.ts";
import OrgLogo from "../../components/OrgLogo.tsx";
import { orgPath } from "../../lib/organizations.ts";
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
import { scrollBehavior } from "../../lib/motion.ts";
@ -468,26 +467,6 @@ function RegionBlock({
color. Selecting another card swaps the panel's contents.
═══════════════════════════════════════════════════════════════ */
/* Logo, or the organization's initials when there's no file or it
fails to load. Decorative: the name is right beside it. */
function OrgLogo({ org, color, size = "h-14 w-14" }) {
return (
<Logo
src={mediaUrl(org.logo)}
className={`${size} object-contain rounded-xl shrink-0`}
fallback={
<div
className={`${size} rounded-xl shrink-0 flex items-center justify-center font-extrabold`}
style={{ border: `1px solid ${color}`, color: accentText(color) }}
aria-hidden="true"
>
{initialsFor(org.name)}
</div>
}
/>
);
}
function ChapterCard({ chapter, color, open, onOpen }) {
return (
<div