Skip to content

Commit d8918fc

Browse files
authored
Merge pull request #1340 from prezly/feature/dev-21147-implement-sharing-to-threads-in-bea
Fix - Skip summary if it's not defined
2 parents 36673c3 + 0c3cf55 commit d8918fc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/SocialShare/SocialShare.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function SocialShare({
8585
className={styles.socialLink}
8686
href={createUrlWithQuery('https://www.linkedin.com/sharing/share-offsite', {
8787
url,
88-
text: `${title}\n\n${summary}\n\n${url}`,
88+
text: [title, summary, url].filter(Boolean).join('\n\n'),
8989
})}
9090
onClick={() => trackSharingEvent(SocialNetwork.LINKEDIN)}
9191
rel="noopener noreferrer"
@@ -131,7 +131,7 @@ export function SocialShare({
131131
aria-label={generateAriaLabel(SocialNetwork.MASTODON)}
132132
className={styles.socialLink}
133133
href={createUrlWithQuery('https://mastodon.social/share', {
134-
text: `${title}\n\n${summary}\n\n${url}`,
134+
text: [title, summary, url].filter(Boolean).join('\n\n'),
135135
})}
136136
onClick={() => trackSharingEvent(SocialNetwork.MASTODON)}
137137
rel="noopener noreferrer"
@@ -148,7 +148,7 @@ export function SocialShare({
148148
href={createUrlWithQuery('https://pinterest.com/pin/create/button/', {
149149
url,
150150
media: thumbnailUrl,
151-
description: `${title}. ${summary}`,
151+
description: [title, summary].filter(Boolean).join(' '),
152152
})}
153153
onClick={() => trackSharingEvent(SocialNetwork.PINTEREST)}
154154
rel="noopener noreferrer"

0 commit comments

Comments
 (0)