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
|
|
@ -1,6 +1,7 @@
|
|||
import { Link } from 'react-router-dom'
|
||||
import { MONTH_LABELS, type PersonRef, type TimelineItem } from '../../../lib/timeline'
|
||||
import { hrefFor, logoSrc, photoSrc } from '../../../lib/timelineRefs'
|
||||
import { MONTH_LABELS, type PersonRef, type TimelineItem } from '../../../lib/timeline.ts'
|
||||
import { hrefFor, logoSrc, photoSrc } from '../../../lib/timelineRefs.ts'
|
||||
import { initials } from '../../../lib/media.ts'
|
||||
|
||||
const KIND_NAMES: Record<TimelineItem['kind'], string> = {
|
||||
milestone: 'Milestone',
|
||||
|
|
@ -10,7 +11,7 @@ const KIND_NAMES: Record<TimelineItem['kind'], string> = {
|
|||
people: 'People',
|
||||
}
|
||||
|
||||
/** Day number only — the month node above already carries the month. */
|
||||
/** Day number only, the month node above already carries the month. */
|
||||
function dayMarker(item: TimelineItem): string {
|
||||
if (item.precision !== 'day') return ''
|
||||
const day = Number(item.date.split('-')[2])
|
||||
|
|
@ -26,16 +27,6 @@ function fullMarker(item: TimelineItem): string {
|
|||
return `${month} ${Number(d)}`
|
||||
}
|
||||
|
||||
/** Initials stand in when a person has no photo on file. */
|
||||
function initials(name: string): string {
|
||||
return name
|
||||
.split(/\s+/)
|
||||
.slice(0, 2)
|
||||
.map((part) => part[0] ?? '')
|
||||
.join('')
|
||||
.toUpperCase()
|
||||
}
|
||||
|
||||
function PersonChip({ person }: { person: PersonRef }) {
|
||||
const src = photoSrc(person.photo)
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue