Show platform icons on link buttons

Links pick their platform from a preset dropdown (PLATFORMS in
src/lib/platforms.ts), and every link button draws that platform's
icon beside its label. The footer and event cards now share the same
PlatformIcon component instead of their own copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 14:45:20 -05:00
parent 99c3a87c87
commit 3c02eb8971
11 changed files with 170 additions and 65 deletions

View file

@ -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 PlatformIcon from '../components/PlatformIcon.tsx'
import ContentBlocks from '../components/ContentBlocks.tsx'
import PeopleTiles from '../components/PeopleTiles.tsx'
import EventListCards from './sections/EventList-Cards.tsx'
@ -324,9 +325,10 @@ function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
href={link.url}
target="_blank"
rel="noreferrer"
className="rounded-full px-5 py-2 text-sm font-semibold text-white transition-transform hover:scale-105"
className="inline-flex items-center gap-2 rounded-full px-5 py-2 text-sm font-semibold text-white transition-transform hover:scale-105"
style={{ background: accent }}
>
<PlatformIcon platform={link.platform} />
{link.label}
</a>
))}
@ -334,8 +336,8 @@ function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
{/* website and email arrive as bare strings (splitLinks in
shape.js); socials are whole link rows. */}
{[
org.website ? { url: org.website, label: 'Website' } : null,
org.email ? { url: `mailto:${org.email}`, label: org.email } : null,
org.website ? { url: org.website, label: 'Website', platform: null } : null,
org.email ? { url: `mailto:${org.email}`, label: org.email, platform: null } : null,
...org.socials,
]
.filter((link): link is NonNullable<typeof link> => Boolean(link))
@ -345,9 +347,10 @@ function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
href={link.url}
target="_blank"
rel="noreferrer"
className="rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
className="inline-flex items-center gap-2 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors hover:bg-[#eef9fb]"
style={{ borderColor: accent, color: accent }}
>
<PlatformIcon platform={link.platform} />
{link.label}
</a>
))}