mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-05 13:44:12 -04:00
Fix calendly link
This commit is contained in:
@@ -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 } = {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user