Map block: sections of its own, shown one at a time
Migration 094 adds content_block_map_sections: a map block groups its venue's locations for its page, eg. Main spaces, without changing the venue. With sections the API cuts the block's venue to the locations they hold, in their order; the list groups under their names, and buttons (All, then each section) show one section's marks and rows. A schedule's place links only when a map on the page shows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
06bf033448
commit
56a6e11655
8 changed files with 200 additions and 43 deletions
|
|
@ -62,7 +62,7 @@ import type { ContentBlock, ContentBlockItem, ItemEvent } from '../lib/useConten
|
|||
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
|
||||
import VideoPlayer from './VideoPlayer.tsx'
|
||||
import ScheduleBlock, { Avatar } from './ScheduleBlock.tsx'
|
||||
import MapBlock, { PageMaps } from './MapBlock.tsx'
|
||||
import MapBlock, { PageMaps, mapAnchor } from './MapBlock.tsx'
|
||||
import { eventHref, personHref } from '../lib/hrefs.ts'
|
||||
import { occurrenceLabel } from '../lib/eventSeries.ts'
|
||||
import { accentText, BRAND } from '../lib/color.ts'
|
||||
|
|
@ -102,8 +102,15 @@ export default function ContentBlocks({
|
|||
})
|
||||
|
||||
|
||||
// The venues mapped here, for a schedule's places to link to.
|
||||
const maps = new Set(blocks.flatMap((block) => (block.type === 'map' && block.venue ? [block.venue.id] : [])))
|
||||
// The places mapped here, for a schedule's places to link to: a
|
||||
// map block's venue's locations (only those its sections show).
|
||||
const maps = new Set(
|
||||
blocks.flatMap((block) =>
|
||||
block.type === 'map' && block.venue
|
||||
? block.venue.locations.map((location) => mapAnchor(block.venue!.id, location.key))
|
||||
: [],
|
||||
),
|
||||
)
|
||||
|
||||
return (
|
||||
<PageMaps.Provider value={maps}>
|
||||
|
|
@ -588,7 +595,7 @@ function Block({
|
|||
|
||||
case 'map':
|
||||
if (!block.venue) return null
|
||||
return <MapBlock venue={block.venue} accent={accent} />
|
||||
return <MapBlock venue={block.venue} sections={block.map_sections} accent={accent} />
|
||||
|
||||
case 'events': {
|
||||
const events = (block.items ?? []).filter((item) => item.event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue