Event page: a contents list, a links heading, full-width blocks; schedule tags in their own row
Migration 089 adds show_contents and links_heading to events (Page group in the editor). The content blocks fill the column, beside the contents list when it shows. A schedule's tag tabs sit in a row of their own under the days, with a note on what they do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
375c364861
commit
b8a744cf41
7 changed files with 149 additions and 61 deletions
|
|
@ -22,6 +22,8 @@ import PageShell, { type ShellSection } from '../components/PageShell.tsx'
|
|||
import PageState from '../components/PageState.tsx'
|
||||
import PlatformIcon from '../components/PlatformIcon.tsx'
|
||||
import ContentBlocks from '../components/ContentBlocks.tsx'
|
||||
import PostContents from '../components/PostContents.tsx'
|
||||
import { headingAnchors } from '../lib/contents.ts'
|
||||
import Tags from '../components/Tags.tsx'
|
||||
import PeopleTiles, { type PeopleGroupInput } from '../components/PeopleTiles.tsx'
|
||||
import {
|
||||
|
|
@ -89,6 +91,9 @@ export default function EventDetail() {
|
|||
|
||||
const accent = event.color || BRAND
|
||||
const groups = peopleGroups(event.people, accent)
|
||||
// Two headings or more make a list worth showing, as on a post.
|
||||
const contents = event.show_contents ? headingAnchors(event.blocks).entries : []
|
||||
const withContents = contents.length >= 2
|
||||
|
||||
const sections: ShellSection[] = [
|
||||
{
|
||||
|
|
@ -109,40 +114,52 @@ export default function EventDetail() {
|
|||
/>
|
||||
)}
|
||||
|
||||
<div className="max-w-3xl">
|
||||
{/* The page as a slideshow for a screen (EventPresent.tsx). */}
|
||||
{event.blocks.length > 0 && (
|
||||
<div className="mb-6 flex justify-end">
|
||||
<Link
|
||||
to={`/events/${encodeURIComponent(event.id)}/present`}
|
||||
target="_blank"
|
||||
className="btn inline-flex items-center gap-2 border px-4 py-2 text-sm transition-colors hover:bg-tint"
|
||||
style={{ borderColor: withAlpha(accent, 33), color: accentText(accent) }}
|
||||
>
|
||||
<Presentation aria-hidden="true" weight="bold" className="h-4 w-4" />
|
||||
Present
|
||||
<span className="sr-only">(opens in a new tab)</span>
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
<ContentBlocks blocks={event.blocks} accent={accent} />
|
||||
{/* The blocks take the column's whole width, beside the
|
||||
contents list when it shows. */}
|
||||
<div className={withContents ? 'grid gap-8 lg:grid-cols-[14rem_minmax(0,1fr)] lg:gap-12 print:block' : undefined}>
|
||||
{withContents && <PostContents entries={contents} />}
|
||||
<div className="min-w-0">
|
||||
{/* The page as a slideshow for a screen (EventPresent.tsx). */}
|
||||
{event.blocks.length > 0 && (
|
||||
<div className="mb-6 flex justify-end">
|
||||
<Link
|
||||
to={`/events/${encodeURIComponent(event.id)}/present`}
|
||||
target="_blank"
|
||||
className="btn inline-flex items-center gap-2 border px-4 py-2 text-sm transition-colors hover:bg-tint"
|
||||
style={{ borderColor: withAlpha(accent, 33), color: accentText(accent) }}
|
||||
>
|
||||
<Presentation aria-hidden="true" weight="bold" className="h-4 w-4" />
|
||||
Present
|
||||
<span className="sr-only">(opens in a new tab)</span>
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
<ContentBlocks blocks={event.blocks} accent={accent} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{event.links.length > 0 && (
|
||||
<div className="flex flex-wrap gap-3">
|
||||
{event.links.map((link) => (
|
||||
<a
|
||||
key={link.url}
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="inline-flex items-center gap-2 btn px-5 py-2 text-sm text-white transition-transform hover:scale-105"
|
||||
style={{ background: accent }}
|
||||
>
|
||||
<PlatformIcon platform={link.platform} />
|
||||
{link.label}
|
||||
</a>
|
||||
))}
|
||||
<div className="space-y-4">
|
||||
{event.links_heading && (
|
||||
<h3 className="text-2xl font-bold" style={{ color: accentText(accent) }}>
|
||||
{event.links_heading}
|
||||
</h3>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-3">
|
||||
{event.links.map((link) => (
|
||||
<a
|
||||
key={link.url}
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="inline-flex items-center gap-2 btn px-5 py-2 text-sm text-white transition-transform hover:scale-105"
|
||||
style={{ background: accent }}
|
||||
>
|
||||
<PlatformIcon platform={link.platform} />
|
||||
{link.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue