/** * PlatformIcons — curated list of social/streaming platforms for the * profile-header social links. Mirrors v9's pcms_profile_platforms() but * with inline SVG so we don't need an icons.svg sprite. * * Each entry: { key, label, brand, host, svg } where: * - key : stable id used in DB (sites.profile_links[].platform) * - label : human readable name * - brand : hex color for hover/icon background * - host : domain hint (used to autodetect from URL if user pastes one) * - svg : inline path data (single ready) */ export const PLATFORMS = { spotify: { label: 'Spotify', brand: '#1DB954', host: 'spotify.com', svg: '', }, bandcamp: { label: 'Bandcamp', brand: '#629AA9', host: 'bandcamp.com', svg: '', }, soundcloud: { label: 'SoundCloud', brand: '#FF5500', host: 'soundcloud.com', svg: '', }, applemusic: { label: 'Apple Music', brand: '#FC3C44', host: 'music.apple.com', // The classic Apple mark (bitten apple + leaf). The previous path was a garbled // app-tile outline that didn't read as the Apple logo at icon size. svg: '', }, youtube: { label: 'YouTube', brand: '#FF0000', host: 'youtube.com', svg: '', }, vimeo: { label: 'Vimeo', brand: '#1AB7EA', host: 'vimeo.com', svg: '', }, instagram: { label: 'Instagram', brand: '#E1306C', host: 'instagram.com', svg: '', }, twitter: { label: 'X (Twitter)', brand: '#000000', host: 'twitter.com', svg: '', }, mastodon: { label: 'Mastodon', brand: '#6364FF', host: 'mastodon.social', svg: '', }, github: { label: 'GitHub', brand: '#181717', host: 'github.com', svg: '', }, website: { label: 'Website', brand: '#999999', host: '', svg: '', }, email: { label: 'Email', brand: '#666666', host: '', svg: '', }, telegram: { label: 'Telegram', brand: '#229ED9', host: 't.me', svg: '', }, whatsapp: { label: 'WhatsApp', brand: '#25D366', host: 'wa.me', svg: '', }, phone: { label: 'Telefoon', brand: '#34A853', host: '', svg: '', }, }; export const PLATFORM_ORDER = [ 'spotify','bandcamp','soundcloud','applemusic','youtube','vimeo', 'instagram','twitter','mastodon','github','website','email','telegram','whatsapp','phone', ]; // Contact-type platforms (shown grouped in the profile summary). export const CONTACT_PLATFORMS = ['email','phone','telegram','whatsapp']; // Build the real href for a profile link (tel:/mailto: prefixes where needed). export function linkHref(platform, url) { const u = String(url || '').trim(); if (platform === 'email' && u && u.indexOf('mailto:') !== 0) return 'mailto:' + u; if (platform === 'phone' && u && !/^tel:/i.test(u)) return 'tel:' + u.replace(/[^\d+]/g, ''); return u; } export function listPlatforms() { return PLATFORM_ORDER.map(k => ({ key: k, ...PLATFORMS[k] })); } export default { PLATFORMS, PLATFORM_ORDER, listPlatforms, CONTACT_PLATFORMS, linkHref };