|
|
@ -4,25 +4,30 @@ import { faFacebookSquare, faRedditSquare, faTwitterSquare } from '@fortawesome/ |
|
|
|
import { getFacebookShareUrl, getRedditShareUrl, getTwitterShareUrl } from "lib/url"; |
|
|
|
import { getFacebookShareUrl, getRedditShareUrl, getTwitterShareUrl } from "lib/url"; |
|
|
|
import { ShareIcon, ShareIconsList, ShareWrap } from './style'; |
|
|
|
import { ShareIcon, ShareIconsList, ShareWrap } from './style'; |
|
|
|
|
|
|
|
|
|
|
|
const ShareGuide = ({ |
|
|
|
const SharePage = ({ |
|
|
|
guide, |
|
|
|
url, |
|
|
|
guide: { |
|
|
|
title, |
|
|
|
author = {} |
|
|
|
twitterUsername, |
|
|
|
} = {} |
|
|
|
|
|
|
|
}) => ( |
|
|
|
}) => ( |
|
|
|
<ShareWrap> |
|
|
|
<ShareWrap> |
|
|
|
<ShareIconsList className="d-sm-none d-md-none d-lg-flex d-xl-flex"> |
|
|
|
<ShareIconsList className="d-sm-none d-md-none d-lg-flex d-xl-flex"> |
|
|
|
<ShareIcon href={ getTwitterShareUrl({ text: `${guide.title} by @${author.twitter}`, url: guide.url })} target="_blank"> |
|
|
|
<ShareIcon |
|
|
|
|
|
|
|
href={ getTwitterShareUrl({ |
|
|
|
|
|
|
|
text: `${title}${twitterUsername ? `by @${twitterUsername}` : ''}`, |
|
|
|
|
|
|
|
url: url |
|
|
|
|
|
|
|
})} |
|
|
|
|
|
|
|
target="_blank" |
|
|
|
|
|
|
|
> |
|
|
|
<FontAwesomeIcon icon={ faTwitterSquare } /> |
|
|
|
<FontAwesomeIcon icon={ faTwitterSquare } /> |
|
|
|
</ShareIcon> |
|
|
|
</ShareIcon> |
|
|
|
<ShareIcon href={ getFacebookShareUrl({ text: guide.title, url: guide.url }) } target="_blank"> |
|
|
|
<ShareIcon href={ getFacebookShareUrl({ text: title, url: url }) } target="_blank"> |
|
|
|
<FontAwesomeIcon icon={ faFacebookSquare } /> |
|
|
|
<FontAwesomeIcon icon={ faFacebookSquare } /> |
|
|
|
</ShareIcon> |
|
|
|
</ShareIcon> |
|
|
|
<ShareIcon href={ getRedditShareUrl({ text: guide.title, url: guide.url })} target="_blank"> |
|
|
|
<ShareIcon href={ getRedditShareUrl({ text: title, url: url })} target="_blank"> |
|
|
|
<FontAwesomeIcon icon={ faRedditSquare } /> |
|
|
|
<FontAwesomeIcon icon={ faRedditSquare } /> |
|
|
|
</ShareIcon> |
|
|
|
</ShareIcon> |
|
|
|
</ShareIconsList> |
|
|
|
</ShareIconsList> |
|
|
|
</ShareWrap> |
|
|
|
</ShareWrap> |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
export default ShareGuide; |
|
|
|
export default SharePage; |