mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-10 17:48:41 -04:00
Add getXShareProfileUrl function for generating profile sharing links with pre-filled text
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {discordLink} from 'common/constants'
|
||||
import {DEPLOYED_WEB_URL} from 'common/envs/constants'
|
||||
|
||||
export const SITE_ORDER = [
|
||||
'site', // personal site
|
||||
@@ -120,3 +121,18 @@ export const PLATFORM_LABELS: {[key in Site]: string} = {
|
||||
workdoc: 'Work Doc',
|
||||
connectiondoc: 'Connection Doc',
|
||||
}
|
||||
|
||||
export function getXShareProfileUrl(
|
||||
username: string,
|
||||
t: (key: string, fallback: string, vars?: Record<string, string | number>) => string,
|
||||
) {
|
||||
const encodedText = encodeURIComponent(
|
||||
t(
|
||||
'share_profile.x_share_profile',
|
||||
"I'm on a platform that matches people by values, not photos.\nNo ads. No algorithms. No swiping. Just depth.",
|
||||
) + '\n@compassmeet',
|
||||
)
|
||||
const encodedUrl = encodeURIComponent(`${DEPLOYED_WEB_URL}/${username}`)
|
||||
|
||||
return `https://x.com/intent/tweet?text=${encodedText}&url=${encodedUrl}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user