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:
Zaldimmar 2026-09-28 22:49:07 -05:00
parent c74ad746f5
commit e4a9c96f7e
42 changed files with 1968 additions and 2043 deletions

View file

@ -23,7 +23,7 @@ import { useState } from 'react'
import HomeLink from '../pages/sections/home/HomeLink.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import { refHref } from '../lib/hrefs.ts'
import { logoForKind } from '../lib/media.ts'
import { mediaUrl } from '../lib/media.ts'
import type { FeaturedCard } from '../lib/useFrontPage.ts'
/* Image kinds that are photographs, drawn edge to edge. Anything
@ -39,7 +39,7 @@ function hrefFor(card: FeaturedCard): string | null {
function Picture({ card }: { card: FeaturedCard }) {
const [failed, setFailed] = useState(false)
const src = card.image ? logoForKind(card.image.kind, card.image.file) : null
const src = card.image ? mediaUrl(card.image.file) : null
const photo = card.image ? PHOTO_KINDS.has(card.image.kind) : false
if (!src || failed) {
@ -68,7 +68,7 @@ function Picture({ card }: { card: FeaturedCard }) {
}
function VideoPicture({ card }: { card: FeaturedCard }) {
const own = card.image ? logoForKind(card.image.kind, card.image.file) : null
const own = card.image ? mediaUrl(card.image.file) : null
return <VideoPlayer url={card.url} still={own} title={card.title} />
}