Finish the audit leftovers
- One mediaUrl in media.ts instead of 12 identical aliases and a kind map; orgPath builds on hrefs.ts's orgHref - One Logo component (hides itself or shows a fallback when the file is missing) for event cards, org lists and chapter marks - useHistory is a thin wrapper over useRecord - adminSchema.ts split into adminSchema/, one file per entity plus shared.ts; the registry is unchanged (checked by loading both) - JS smooth scrolls respect reduced motion (lib/motion.ts) - Content-Security-Policy in Report-Only, with /api/csp-report logging what it would block Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c74ad746f5
commit
e4a9c96f7e
42 changed files with 1968 additions and 2043 deletions
|
|
@ -24,7 +24,7 @@ import { useId, useState, type KeyboardEvent } from 'react'
|
|||
import { Link } from 'react-router-dom'
|
||||
|
||||
import { personHref } from '../lib/hrefs.ts'
|
||||
import { blockMedia, initials, personPhoto } from '../lib/media.ts'
|
||||
import { mediaUrl, initials } from '../lib/media.ts'
|
||||
import type { ContentBlockItem } from '../lib/useContent.ts'
|
||||
import { Anchor, Paragraphs } from './InlineText.tsx'
|
||||
import { withAlpha, accentText, readableOn } from '../lib/color.ts'
|
||||
|
|
@ -66,7 +66,7 @@ const mapLink = (place: string) =>
|
|||
|
||||
function Avatar({ person, size }: { person: NonNullable<ContentBlockItem['person']>; size: string }) {
|
||||
const [failed, setFailed] = useState(false)
|
||||
const src = personPhoto(person.photo)
|
||||
const src = mediaUrl(person.photo)
|
||||
return src && !failed ? (
|
||||
<img src={src} alt="" onError={() => setFailed(true)} className={`${size} shrink-0 rounded-full object-cover`} />
|
||||
) : (
|
||||
|
|
@ -84,7 +84,7 @@ function Entry({ entry, accent }: { entry: ContentBlockItem; accent: string }) {
|
|||
// Google's map loads only when asked for (Privacy page).
|
||||
const [showMap, setShowMap] = useState(false)
|
||||
const panelId = useId()
|
||||
const graphic = blockMedia(entry.media)
|
||||
const graphic = mediaUrl(entry.media)
|
||||
const place = entry.map?.trim()
|
||||
const more = Boolean(entry.description || graphic || place || entry.person)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue