Make link cards smaller, up to three in a row
One grid whatever the count, so a lone card takes a column rather than the width. Also the Blog Posts request folder's name, as it is in Drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a98aea6bca
commit
9ff1cd6e99
4 changed files with 13 additions and 10 deletions
|
|
@ -24,8 +24,9 @@
|
|||
a fold-out of description, media, map);
|
||||
text is an optional intro. ScheduleBlock
|
||||
table text: a row per line, cells split by |
|
||||
cards items as link cards: text the title,
|
||||
detail, url, media the picture
|
||||
cards items as link cards, up to three in a row:
|
||||
text the title, detail, url, media the
|
||||
picture
|
||||
divider nothing
|
||||
|
||||
"Formatted" is InlineText.tsx: **bold**, *italic*, [text](url),
|
||||
|
|
@ -95,10 +96,10 @@ function LinkCard({ item }: { item: ContentBlockItem }) {
|
|||
{!img.failed && (
|
||||
<img src={img.src} alt="" loading="lazy" onError={img.onError} className="aspect-video w-full object-cover" />
|
||||
)}
|
||||
<span className="flex flex-1 flex-col gap-1 p-5">
|
||||
<span className="text-xs font-semibold text-muted">{where}</span>
|
||||
<span className="font-display text-lg font-bold leading-snug text-ink group-hover:text-link">{item.text}</span>
|
||||
{item.detail && <span className="line-clamp-3 text-sm text-body">{item.detail}</span>}
|
||||
<span className="flex flex-1 flex-col gap-1 p-4">
|
||||
<span className="truncate text-xs font-semibold text-muted">{where}</span>
|
||||
<span className="font-display text-base font-bold leading-snug text-ink group-hover:text-link">{item.text}</span>
|
||||
{item.detail && <span className="line-clamp-3 text-sm leading-snug text-body">{item.detail}</span>}
|
||||
</span>
|
||||
</Anchor>
|
||||
)
|
||||
|
|
@ -224,7 +225,9 @@ function Block({ block, accent, anchor }: { block: ContentBlock; accent: string;
|
|||
const cards = (block.items ?? []).filter((item) => item.url && item.text)
|
||||
if (cards.length === 0) return null
|
||||
return (
|
||||
<ul className={cards.length === 1 ? 'max-w-xl' : 'grid gap-4 sm:grid-cols-2'}>
|
||||
// One grid whatever the count: a lone card takes a column
|
||||
// rather than the width, and more sit up to three in a row.
|
||||
<ul className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{cards.map((item, i) => (
|
||||
<li key={i}>
|
||||
<LinkCard item={item} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue