2019-11-02 23:58:17 +04:00
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
2019-11-03 01:26:06 +04:00
|
|
|
import { faFacebookSquare, faRedditSquare, faTwitterSquare } from '@fortawesome/free-brands-svg-icons'
|
2019-11-02 23:58:17 +04:00
|
|
|
|
2019-11-06 22:59:43 +04:00
|
|
|
import { getFacebookShareUrl, getRedditShareUrl, getTwitterShareUrl } from "lib/url";
|
2019-11-02 23:58:17 +04:00
|
|
|
import { ShareIcon, ShareIconsList, ShareWrap } from './style';
|
2019-11-02 19:41:40 +04:00
|
|
|
|
2019-11-06 22:59:43 +04:00
|
|
|
const ShareGuide = ({
|
|
|
|
guide,
|
|
|
|
guide: {
|
|
|
|
author = {}
|
|
|
|
} = {}
|
|
|
|
}) => (
|
2019-11-02 19:41:40 +04:00
|
|
|
<ShareWrap>
|
|
|
|
<ShareIconsList className="d-sm-none d-md-none d-lg-flex d-xl-flex">
|
2019-11-08 01:32:01 +04:00
|
|
|
<ShareIcon href={ getTwitterShareUrl({ text: `${guide.title} by @${author.twitter}`, url: guide.url })} target="_blank">
|
2019-11-06 22:59:43 +04:00
|
|
|
<FontAwesomeIcon icon={ faTwitterSquare } />
|
|
|
|
</ShareIcon>
|
2019-11-08 01:32:01 +04:00
|
|
|
<ShareIcon href={ getFacebookShareUrl({ text: guide.title, url: guide.url }) } target="_blank">
|
|
|
|
<FontAwesomeIcon icon={ faFacebookSquare } />
|
2019-11-06 22:59:43 +04:00
|
|
|
</ShareIcon>
|
2019-11-08 01:32:01 +04:00
|
|
|
<ShareIcon href={ getRedditShareUrl({ text: guide.title, url: guide.url })} target="_blank">
|
|
|
|
<FontAwesomeIcon icon={ faRedditSquare } />
|
2019-11-06 22:59:43 +04:00
|
|
|
</ShareIcon>
|
2019-11-02 19:41:40 +04:00
|
|
|
</ShareIconsList>
|
|
|
|
</ShareWrap>
|
|
|
|
);
|
|
|
|
|
2019-11-06 22:59:43 +04:00
|
|
|
export default ShareGuide;
|