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:
parent
99c3a87c87
commit
3c02eb8971
11 changed files with 170 additions and 65 deletions
|
|
@ -22,6 +22,7 @@ import { Link, useParams } from 'react-router-dom'
|
|||
|
||||
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 {
|
||||
usePerson,
|
||||
|
|
@ -243,9 +244,9 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
|
|||
|
||||
function Contact({ person, accent }: { person: PersonRecord; accent: string }) {
|
||||
const outlined = [
|
||||
person.website ? { url: person.website, label: 'Website' } : null,
|
||||
person.website ? { url: person.website, label: 'Website', platform: null } : null,
|
||||
person.public_email
|
||||
? { url: `mailto:${person.public_email}`, label: person.public_email }
|
||||
? { url: `mailto:${person.public_email}`, label: person.public_email, platform: null }
|
||||
: null,
|
||||
...person.socials,
|
||||
].filter((link): link is NonNullable<typeof link> => Boolean(link))
|
||||
|
|
@ -260,9 +261,10 @@ function Contact({ person, accent }: { person: PersonRecord; 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>
|
||||
))}
|
||||
|
|
@ -273,9 +275,10 @@ function Contact({ person, accent }: { person: PersonRecord; 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>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue