Regions: featured cards in the region list and on the region's page (migration 072)
A region owns featured cards like the front page does, set in its editor (shown when Kind is region). They show in its row of the region list when opened, and in a Featured section on its page. featured_cards takes an 'organization' owner kind; the table is rebuilt, and a region's cards go when it does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
07be48d770
commit
2977168af5
9 changed files with 181 additions and 17 deletions
|
|
@ -20,6 +20,7 @@ import { Link, Navigate, useLocation, useParams } from 'react-router-dom'
|
|||
import PageShell from '../components/PageShell.tsx'
|
||||
import PageState from '../components/PageState.tsx'
|
||||
import ContentBlocks from '../components/ContentBlocks.tsx'
|
||||
import FeaturedCards from '../components/FeaturedCards.tsx'
|
||||
import OrgTeams, { hasTeams } from '../components/OrgTeams.tsx'
|
||||
import OrgContact from '../components/OrgContact.tsx'
|
||||
import Tags from '../components/Tags.tsx'
|
||||
|
|
@ -94,6 +95,21 @@ export default function OrganizationDetail() {
|
|||
},
|
||||
]
|
||||
|
||||
// A region's own featured cards, the same ones its row in the
|
||||
// region list shows.
|
||||
if (org.kind === 'region' && (org.details.featured?.length ?? 0) > 0) {
|
||||
sections.push({
|
||||
id: 'featured',
|
||||
title: 'Featured',
|
||||
accent,
|
||||
content: (
|
||||
<div className="max-w-6xl mx-auto px-6">
|
||||
<FeaturedCards cards={org.details.featured ?? []} />
|
||||
</div>
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
if (hasTeams(org)) {
|
||||
sections.push({
|
||||
id: 'leadership',
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { ArrowUpRight, CaretRight } from '@phosphor-icons/react';
|
|||
import { useId, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import ArrowLink from "../../components/ArrowLink.tsx";
|
||||
import FeaturedCards from "../../components/FeaturedCards.tsx";
|
||||
import { mediaUrl } from "../../lib/media.ts";
|
||||
import Logo from "../../components/Logo.tsx";
|
||||
import PlatformIcon from "../../components/PlatformIcon.tsx";
|
||||
|
|
@ -38,9 +39,9 @@ import { useReadingMode } from '../../lib/readingMode.ts'
|
|||
groupBy={org => org.details?.scope}
|
||||
/>
|
||||
|
||||
Kind-specific extras (the areas a region covers, its map note)
|
||||
come from `details` and render only when present, so a partner
|
||||
row simply doesn't have them.
|
||||
Kind-specific extras (the areas a region covers, its map note,
|
||||
its featured cards) come from `details` and render only when
|
||||
present, so a partner row simply doesn't have them.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
const MUTED = "var(--color-muted)";
|
||||
|
|
@ -100,9 +101,12 @@ function OrgRow({ org, pageLabel, siteLabel, titled }) {
|
|||
exactly once rather than in both places. */
|
||||
const summary = org.tagline;
|
||||
|
||||
// A region's own featured cards, last in the panel.
|
||||
const featured = org.details?.featured ?? [];
|
||||
|
||||
// Something has to be behind the chevron or opening it does nothing.
|
||||
const hasPanel =
|
||||
org.description?.length > 0 || areas || note || org.links?.length > 0;
|
||||
org.description?.length > 0 || areas || note || org.links?.length > 0 || featured.length > 0;
|
||||
|
||||
return (
|
||||
<div className="py-3" style={{ borderTop: `1px solid ${RULE}` }}>
|
||||
|
|
@ -214,6 +218,12 @@ function OrgRow({ org, pageLabel, siteLabel, titled }) {
|
|||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{featured.length > 0 && (
|
||||
<div className="pt-2">
|
||||
<FeaturedCards cards={featured} level={titled ? 5 : 4} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue