Skip to content

Commit

Permalink
Handles empty Twitter share "hashtags"
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Sep 4, 2020
1 parent b28ab8d commit b4d35a5
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/components/SocialLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ export const ShareInFacebook: React.FC<ShareComponentProps> = ({ url }) => {
)
}

export const ShareInTwitter: React.FC<ShareComponentProps & {
title: string
hashtags?: string[]
}> = (props) => {
export const ShareInTwitter: React.FC<
ShareComponentProps & {
title: string
hashtags?: string[]
}
> = (props) => {
return (
<Box flex as={TwitterShareButton} {...props} aria-label="Share on Twitter">
<Box
flex
as={TwitterShareButton}
{...props}
hashtags={props.hashtags || []}
aria-label="Share on Twitter"
>
<GeneralIcon as={TwitterIcon} {...SOCIAL_ICON_PROPS} />
</Box>
)
Expand All @@ -49,9 +57,11 @@ ShareInTwitter.defaultProps = {
hashtags: [],
}

export const ShareInReddit: React.FC<ShareComponentProps & {
title: string
}> = ({ url, title }) => {
export const ShareInReddit: React.FC<
ShareComponentProps & {
title: string
}
> = ({ url, title }) => {
return (
<Box
flex
Expand Down

0 comments on commit b4d35a5

Please sign in to comment.