Skip to content

Commit 89b42a5

Browse files
authored
Merge branch 'main' into test-scroll-restoration-empty-fallback
2 parents 6c6968d + 4861a02 commit 89b42a5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

components/ShareButtons.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ interface ShareButtonsProps {
66
}
77

88
export default function ShareButtons({ url, title = '' }: ShareButtonsProps) {
9-
const linkedinUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(url)}`;
10-
const twitterUrl = `https://twitter.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent(title)}`;
9+
const linkedinUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(
10+
url
11+
)}`;
12+
const twitterUrl =
13+
`https://x.com/intent/tweet?url=${encodeURIComponent(url)}` +
14+
(title ? `&text=${encodeURIComponent(title)}` : '');
1115

1216
return (
1317
<div className="flex gap-3">

0 commit comments

Comments
 (0)