diff --git a/web/components/buttons/copy-link-button.tsx b/web/components/buttons/copy-link-button.tsx index 02ffa5ca..87a833c1 100644 --- a/web/components/buttons/copy-link-button.tsx +++ b/web/components/buttons/copy-link-button.tsx @@ -1,6 +1,7 @@ import {CheckIcon, ClipboardIcon, DocumentDuplicateIcon} from '@heroicons/react/24/outline' import {LinkIcon} from '@heroicons/react/24/solid' import clsx from 'clsx' +import {getXShareProfileUrl} from 'common/socials' import {ComponentProps, useState} from 'react' import toast from 'react-hot-toast' import {Button, ColorType, IconButton, SizeType} from 'web/components/buttons/button' @@ -183,12 +184,7 @@ export const share = async (url: string) => { window.open(url, '_blank', 'noopener,noreferrer') } } -export const shareOnX = (profileUrl: string, text: string) => { - const encodedText = encodeURIComponent(text) - const encodedUrl = encodeURIComponent(profileUrl) - - const shareUrl = `https://twitter.com/intent/tweet?text=${encodedText}&url=${encodedUrl}` - +export const shareOnX = (shareUrl: string) => { window.open(shareUrl, '_blank', 'noopener,noreferrer') } export const shareOnLinkedIn = (profileUrl: string) => { @@ -198,17 +194,13 @@ export const shareOnLinkedIn = (profileUrl: string) => { window.open(shareUrl, '_blank', 'noopener,noreferrer') } + export const ShareProfileOnXButton = (props: {username: string; className?: string}) => { const {username, className} = props const t = useT() return ( - )