Skip to content

Commit 60eb0c6

Browse files
committed
Add 'datingdoc', 'friendshipdoc', 'connectiondoc', 'workdoc'
1 parent 475f0af commit 60eb0c6

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

‎common/src/socials.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export const SITE_ORDER = [
1515
'patreon',
1616
'okcupid',
1717
'calendly',
18+
'datingdoc',
19+
'friendshipdoc',
20+
'connectiondoc',
21+
'workdoc',
1822
'spotify',
1923
] as const
2024

@@ -44,6 +48,10 @@ const stripper: { [key in Site]: (input: string) => string } = {
4448
.replace(/\/$/, ''),
4549
okcupid: (s) => s.replace(/^(https?:\/\/)/, ''),
4650
calendly: (s) => s,
51+
datingdoc: (s) => s,
52+
friendshipdoc: (s) => s,
53+
workdoc: (s) => s,
54+
connectiondoc: (s) => s,
4755
bluesky: (s) =>
4856
s
4957
.replace(/^(https?:\/\/)?(www\.)?bsky\.app\/profile\//, '')
@@ -99,6 +107,10 @@ const urler: { [key in Site]: (handle: string) => string } = {
99107
paypal: (s) => `https://paypal.com/paypalme/${s}`,
100108
patreon: (s) => `https://patreon.com/${s}`,
101109
calendly: (s) => (s.startsWith('http') ? s : `https://${s}`),
110+
datingdoc: (s) => (s.startsWith('http') ? s : `https://${s}`),
111+
friendshipdoc: (s) => (s.startsWith('http') ? s : `https://${s}`),
112+
workdoc: (s) => (s.startsWith('http') ? s : `https://${s}`),
113+
connectiondoc: (s) => (s.startsWith('http') ? s : `https://${s}`),
102114
}
103115

104116
export const PLATFORM_LABELS: { [key in Site]: string } = {
@@ -117,4 +129,8 @@ export const PLATFORM_LABELS: { [key in Site]: string } = {
117129
patreon: 'Patreon',
118130
okcupid: 'OkCupid',
119131
calendly: 'Calendly',
132+
datingdoc: 'Dating Doc',
133+
friendshipdoc: 'Friendship Doc',
134+
workdoc: 'Work Doc',
135+
connectiondoc: 'Connection Doc',
120136
}

‎web/components/user/social.tsx‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { LinkIcon } from '@heroicons/react/solid'
2-
import { Site } from 'common/socials'
3-
import { ReactNode } from 'react'
4-
import { LuBookmark, LuHeart } from 'react-icons/lu'
1+
import {DocumentReportIcon, LinkIcon} from '@heroicons/react/solid'
2+
import {Site} from 'common/socials'
3+
import {ReactNode} from 'react'
4+
import {LuBookmark, LuHandshake, LuHeart, LuUsers} from 'react-icons/lu'
55
import {
66
TbBrandBluesky,
77
TbBrandDiscord,
@@ -34,6 +34,10 @@ export const PLATFORM_ICONS: {
3434
patreon: TbBrandPatreon,
3535
paypal: TbBrandPaypal,
3636
okcupid: LuHeart,
37+
datingdoc: LuHeart,
38+
friendshipdoc: LuUsers,
39+
workdoc: DocumentReportIcon,
40+
connectiondoc: LuHandshake,
3741
calendly: TbCalendar,
3842
}
3943

@@ -43,7 +47,7 @@ export const SocialIcon = (props: {
4347
size?: number;
4448
color?: string;
4549
}) => {
46-
const { site, ...rest } = props
50+
const {site, ...rest} = props
4751
const Icon = PLATFORM_ICONS[site as Site] || PLATFORM_ICONS.site
4852

4953
return <Icon {...rest} />

‎web/components/user/user-handles.tsx‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
import {Row} from '../layout/row'
22
import clsx from 'clsx'
3-
import {getSocialUrl, SITE_ORDER, Socials} from 'common/socials'
3+
import {getSocialUrl, PLATFORM_LABELS, Site, SITE_ORDER, Socials} from 'common/socials'
44
import {sortBy} from 'lodash'
55
import {SocialIcon} from './social'
66

7-
const LABEL_TO_RENDER: Record<string, string> = {
8-
okcupid: 'OkCupid',
9-
calendly: 'Calendly',
10-
}
7+
const LABELS_TO_RENDER = [
8+
'okcupid',
9+
'calendly',
10+
'datingdoc',
11+
'friendshipdoc',
12+
'connectiondoc',
13+
'workdoc',
14+
]
1115

1216
export function UserHandles(props: { links: Socials; className?: string }) {
1317
const {links, className} = props
1418

1519
const display = sortBy(
1620
Object.entries(links),
17-
([platform]) => -[...SITE_ORDER].reverse().indexOf(platform as any)
21+
([platform]) => -[...SITE_ORDER].reverse().indexOf(platform as Site)
1822
).map(([platform, label]) => {
19-
const renderedLabel = LABEL_TO_RENDER[platform] || label
23+
const renderedLabel: string = LABELS_TO_RENDER.includes(platform) ? PLATFORM_LABELS[platform as Site] : label
2024
return {
2125
platform,
2226
label: renderedLabel,

0 commit comments

Comments
 (0)