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
29
src/lib/platforms.ts
Normal file
29
src/lib/platforms.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
LINK PLATFORMS
|
||||
|
||||
The preset values for links.platform. Order here is the order
|
||||
the admin's Platform dropdown lists them in.
|
||||
|
||||
links.platform is a plain TEXT column with no CHECK: a platform
|
||||
carries nothing but an icon, and an unknown value just draws a
|
||||
button without one. So adding a platform is two edits, both in
|
||||
code: an entry here and its icon in PlatformIcon.tsx. The type
|
||||
below makes the icon list refuse to compile without it.
|
||||
|
||||
'instagram' is also read by splitLinks in server/src/shape.js,
|
||||
which lifts the handle out for the event cards' follow button.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
export const PLATFORMS = [
|
||||
{ id: 'instagram', label: 'Instagram' },
|
||||
{ id: 'facebook', label: 'Facebook' },
|
||||
{ id: 'discord', label: 'Discord' },
|
||||
{ id: 'youtube', label: 'YouTube' },
|
||||
{ id: 'tiktok', label: 'TikTok' },
|
||||
{ id: 'x', label: 'X (Twitter)' },
|
||||
{ id: 'substack', label: 'Substack' },
|
||||
{ id: 'spotify', label: 'Spotify' },
|
||||
{ id: 'linkedin', label: 'LinkedIn' },
|
||||
] as const
|
||||
|
||||
export type Platform = (typeof PLATFORMS)[number]['id']
|
||||
Loading…
Add table
Add a link
Reference in a new issue