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>
This commit is contained in:
parent
4066e9ec61
commit
5274e09571
75 changed files with 282 additions and 688 deletions
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
@ -147,10 +147,10 @@ export default function Layout() {
|
|||
className="fixed top-0 left-0 right-0 z-50 backdrop-blur-md"
|
||||
>
|
||||
|
||||
{/* 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 +201,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"
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
@ -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,7 +71,7 @@ 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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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" }} /> */
|
||||
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import { Link } from "react-router-dom";
|
|||
|
||||
import { get } from "../lib/api.ts";
|
||||
import { isBadId, personHref } from "../lib/hrefs.ts";
|
||||
import { personPhoto } from "../lib/media.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:
|
||||
*
|
||||
|
|
@ -33,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.
|
||||
*
|
||||
|
|
@ -42,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
|
||||
|
|
@ -51,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.
|
||||
*/
|
||||
|
||||
|
|
@ -136,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.
|
||||
───────────────────────────────────────────────────────────── */
|
||||
|
||||
|
|
@ -290,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[],
|
||||
|
|
@ -741,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;
|
||||
}
|
||||
|
|
@ -762,15 +762,6 @@ function hasDetails(person: Person): boolean {
|
|||
}
|
||||
|
||||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue