Changeset 1b99225 in Klonkt for src/services/PlatformIcons.js


Ignore:
Timestamp:
06/27/2026 12:57:02 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
e390844
Parents:
16e99e5
Message:

feat(profile): click avatar -> profile summary modal (contacts, since, premium)

Clicking the profile photo now opens a summary card: enlarged photo, name, premium/free
badge, bio, all profile links (with telegram/phone/whatsapp added to the platform
catalog + tel:/mailto: hrefs), and 'On Klonkt since <date>'. Replaces the bare image
lightbox. New i18n profile.since/profile.free.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/PlatformIcons.js

    r16e99e5 r1b99225  
    8585    svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>',
    8686  },
     87  telegram: {
     88    label: 'Telegram',
     89    brand: '#229ED9',
     90    host: 't.me',
     91    svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>',
     92  },
     93  whatsapp: {
     94    label: 'WhatsApp',
     95    brand: '#25D366',
     96    host: 'wa.me',
     97    svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z"/></svg>',
     98  },
     99  phone: {
     100    label: 'Telefoon',
     101    brand: '#34A853',
     102    host: '',
     103    svg: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/></svg>',
     104  },
    87105};
    88106
    89107export const PLATFORM_ORDER = [
    90108  'spotify','bandcamp','soundcloud','applemusic','youtube','vimeo',
    91   'instagram','twitter','mastodon','github','website','email',
     109  'instagram','twitter','mastodon','github','website','email','telegram','whatsapp','phone',
    92110];
     111
     112// Contact-type platforms (shown grouped in the profile summary).
     113export const CONTACT_PLATFORMS = ['email','phone','telegram','whatsapp'];
     114
     115// Build the real href for a profile link (tel:/mailto: prefixes where needed).
     116export function linkHref(platform, url) {
     117  const u = String(url || '').trim();
     118  if (platform === 'email' && u && u.indexOf('mailto:') !== 0) return 'mailto:' + u;
     119  if (platform === 'phone' && u && !/^tel:/i.test(u)) return 'tel:' + u.replace(/[^\d+]/g, '');
     120  return u;
     121}
    93122
    94123export function listPlatforms() {
     
    96125}
    97126
    98 export default { PLATFORMS, PLATFORM_ORDER, listPlatforms };
     127export default { PLATFORMS, PLATFORM_ORDER, listPlatforms, CONTACT_PLATFORMS, linkHref };
Note: See TracChangeset for help on using the changeset viewer.