computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; |
|
import { faFacebookSquare, faRedditSquare, faTwitterSquare } from '@fortawesome/free-brands-svg-icons' |
|
|
|
import { getFacebookShareUrl, getRedditShareUrl, getTwitterShareUrl } from "lib/url"; |
|
import { ShareIcon, ShareIconsList, ShareWrap } from './style'; |
|
|
|
const SharePage = ({ |
|
url, |
|
title, |
|
twitterUsername, |
|
}) => ( |
|
<ShareWrap> |
|
<ShareIconsList className="d-sm-none d-md-none d-lg-flex d-xl-flex"> |
|
<ShareIcon |
|
href={ getTwitterShareUrl({ |
|
text: `${title} ${twitterUsername ? `by @${twitterUsername}` : ''}`, |
|
url: url |
|
})} |
|
target="_blank" |
|
> |
|
<FontAwesomeIcon icon={ faTwitterSquare } /> |
|
</ShareIcon> |
|
<ShareIcon href={ getFacebookShareUrl({ text: title, url: url }) } target="_blank"> |
|
<FontAwesomeIcon icon={ faFacebookSquare } /> |
|
</ShareIcon> |
|
<ShareIcon href={ getRedditShareUrl({ text: title, url: url })} target="_blank"> |
|
<FontAwesomeIcon icon={ faRedditSquare } /> |
|
</ShareIcon> |
|
</ShareIconsList> |
|
</ShareWrap> |
|
); |
|
|
|
export default SharePage;
|
|
|