Skip to content

Commit 3367f07

Browse files
authored
Update links to x.com (#174)
1 parent 7eeac39 commit 3367f07

File tree

5 files changed

+9846
-7699
lines changed

5 files changed

+9846
-7699
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
"prettier": "^2.8.4",
2424
"turbo": "^1.8.3"
2525
},
26-
"packageManager": "pnpm@8.14.3"
26+
"packageManager": "pnpm@9.5.0"
2727
}

packages/react-tweet/src/twitter-theme/tweet-actions-copy.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import s from './tweet-actions.module.css'
66

77
export const TweetActionsCopy = ({ tweet }: { tweet: EnrichedTweet }) => {
88
const [copied, setCopied] = useState(false)
9-
const [copyAllText, setCopyAltText] = useState(false)
109
const handleCopy = () => {
1110
navigator.clipboard.writeText(tweet.url)
1211
setCopied(true)
@@ -16,7 +15,6 @@ export const TweetActionsCopy = ({ tweet }: { tweet: EnrichedTweet }) => {
1615
if (copied) {
1716
const timeout = setTimeout(() => {
1817
setCopied(false)
19-
setCopyAltText(true)
2018
}, 6000)
2119

2220
return () => clearTimeout(timeout)
@@ -45,9 +43,7 @@ export const TweetActionsCopy = ({ tweet }: { tweet: EnrichedTweet }) => {
4543
</svg>
4644
)}
4745
</div>
48-
<span className={s.copyText}>
49-
{copied ? 'Copied!' : copyAllText ? 'Copy link to Tweet' : 'Copy link'}
50-
</span>
46+
<span className={s.copyText}>{copied ? 'Copied!' : 'Copy link'}</span>
5147
</button>
5248
)
5349
}

packages/react-tweet/src/twitter-theme/tweet-info.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const TweetInfo = ({ tweet }: { tweet: EnrichedTweet }) => (
77
<TweetInfoCreatedAt tweet={tweet} />
88
<a
99
className={s.infoLink}
10-
href="https://help.twitter.com/en/twitter-for-websites-ads-info-and-privacy"
10+
href="https://help.x.com/en/x-for-websites-ads-info-and-privacy"
1111
target="_blank"
1212
rel="noopener noreferrer"
1313
aria-label="Twitter for Websites, Ads Information and Privacy"

packages/react-tweet/src/utils.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ export type TweetCoreProps = {
1919
}
2020

2121
const getTweetUrl = (tweet: TweetBase) =>
22-
`https://twitter.com/${tweet.user.screen_name}/status/${tweet.id_str}`
22+
`https://x.com/${tweet.user.screen_name}/status/${tweet.id_str}`
2323

2424
const getUserUrl = (usernameOrTweet: string | TweetBase) =>
25-
`https://twitter.com/${
25+
`https://x.com/${
2626
typeof usernameOrTweet === 'string'
2727
? usernameOrTweet
2828
: usernameOrTweet.user.screen_name
2929
}`
3030

3131
const getLikeUrl = (tweet: TweetBase) =>
32-
`https://twitter.com/intent/like?tweet_id=${tweet.id_str}`
32+
`https://x.com/intent/like?tweet_id=${tweet.id_str}`
3333

3434
const getReplyUrl = (tweet: TweetBase) =>
35-
`https://twitter.com/intent/tweet?in_reply_to=${tweet.id_str}`
35+
`https://x.com/intent/tweet?in_reply_to=${tweet.id_str}`
3636

3737
const getFollowUrl = (tweet: TweetBase) =>
38-
`https://twitter.com/intent/follow?screen_name=${tweet.user.screen_name}`
38+
`https://x.com/intent/follow?screen_name=${tweet.user.screen_name}`
3939

4040
const getHashtagUrl = (hashtag: HashtagEntity) =>
41-
`https://twitter.com/hashtag/${hashtag.text}`
41+
`https://x.com/hashtag/${hashtag.text}`
4242

4343
const getSymbolUrl = (symbol: SymbolEntity) =>
44-
`https://twitter.com/search?q=%24${symbol.text}`
44+
`https://x.com/search?q=%24${symbol.text}`
4545

4646
const getInReplyToUrl = (tweet: Tweet) =>
47-
`https://twitter.com/${tweet.in_reply_to_screen_name}/status/${tweet.in_reply_to_status_id_str}`
47+
`https://x.com/${tweet.in_reply_to_screen_name}/status/${tweet.in_reply_to_status_id_str}`
4848

4949
export const getMediaUrl = (
5050
media: MediaDetails,

0 commit comments

Comments
 (0)