Fix calendly link

This commit is contained in:
MartinBraquet
2025-09-22 10:52:46 +02:00
parent 02f613d269
commit 5004b73210
2 changed files with 8 additions and 7 deletions

View File

@@ -43,10 +43,7 @@ const stripper: { [key in Site]: (input: string) => string } = {
.replace(/^(https?:\/\/)?(www\.)?(\w+\.)?patreon\.com\//, '')
.replace(/\/$/, ''),
okcupid: (s) => s.replace(/^(https?:\/\/)/, ''),
calendly: (s) =>
s
.replace(/^(https?:\/\/)?(www\.)?(\w+\.)?calendly\.com\//, '')
.replace(/\/$/, ''),
calendly: (s) => s,
bluesky: (s) =>
s
.replace(/^(https?:\/\/)?(www\.)?bsky\.app\/profile\//, '')
@@ -101,7 +98,7 @@ const urler: { [key in Site]: (handle: string) => string } = {
spotify: (s) => `https://open.spotify.com/user/${s}`,
paypal: (s) => `https://paypal.com/paypalme/${s}`,
patreon: (s) => `https://patreon.com/${s}`,
calendly: (s) => `https://calendly.com/${s}`,
calendly: (s) => (s.startsWith('http') ? s : `https://${s}`),
}
export const PLATFORM_LABELS: { [key in Site]: string } = {

View File

@@ -4,6 +4,11 @@ import {getSocialUrl, SITE_ORDER, Socials} from 'common/socials'
import {sortBy} from 'lodash'
import {SocialIcon} from './social'
const LABEL_TO_RENDER: Record<string, string> = {
okcupid: 'OkCupid',
calendly: 'Calendly',
}
export function UserHandles(props: { links: Socials; className?: string }) {
const {links, className} = props
@@ -11,8 +16,7 @@ export function UserHandles(props: { links: Socials; className?: string }) {
Object.entries(links),
([platform]) => -[...SITE_ORDER].reverse().indexOf(platform as any)
).map(([platform, label]) => {
let renderedLabel = label
if (platform === 'okcupid') renderedLabel = 'OkCupid'
const renderedLabel = LABEL_TO_RENDER[platform] || label
return {
platform,
label: renderedLabel,