Share gudie widget on the sidebar
This commit is contained in:
@ -1,16 +1,34 @@
|
|||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faFacebookSquare, faRedditSquare, faTwitterSquare } from '@fortawesome/free-brands-svg-icons'
|
import { faFacebookSquare, faRedditSquare, faTwitterSquare } from '@fortawesome/free-brands-svg-icons'
|
||||||
|
|
||||||
|
import { getFacebookShareUrl, getRedditShareUrl, getTwitterShareUrl } from "lib/url";
|
||||||
import { ShareIcon, ShareIconsList, ShareWrap } from './style';
|
import { ShareIcon, ShareIconsList, ShareWrap } from './style';
|
||||||
|
|
||||||
const ShareGuide = (props) => (
|
const ShareGuide = ({
|
||||||
|
guide,
|
||||||
|
guide: {
|
||||||
|
author = {}
|
||||||
|
} = {}
|
||||||
|
}) => (
|
||||||
<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><a href="#"><FontAwesomeIcon icon={ faTwitterSquare } /></a></ShareIcon>
|
<ShareIcon>
|
||||||
<ShareIcon><a href="#"><FontAwesomeIcon icon={ faFacebookSquare } /></a></ShareIcon>
|
<a href={ getTwitterShareUrl({ text: `${guide.title} by @${author.twitter}`, url: guide.url })} target="_blank">
|
||||||
<ShareIcon><a href="#"><FontAwesomeIcon icon={ faRedditSquare } /></a></ShareIcon>
|
<FontAwesomeIcon icon={ faTwitterSquare } />
|
||||||
|
</a>
|
||||||
|
</ShareIcon>
|
||||||
|
<ShareIcon>
|
||||||
|
<a href={ getFacebookShareUrl({ text: guide.title, url: guide.url }) } target="_blank">
|
||||||
|
<FontAwesomeIcon icon={ faFacebookSquare } />
|
||||||
|
</a>
|
||||||
|
</ShareIcon>
|
||||||
|
<ShareIcon>
|
||||||
|
<a href={ getRedditShareUrl({ text: guide.title, url: guide.url })} target="_blank">
|
||||||
|
<FontAwesomeIcon icon={ faRedditSquare } />
|
||||||
|
</a>
|
||||||
|
</ShareIcon>
|
||||||
</ShareIconsList>
|
</ShareIconsList>
|
||||||
</ShareWrap>
|
</ShareWrap>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default ShareGuide;
|
export default ShareGuide;
|
||||||
|
@ -14,12 +14,12 @@ const Guide = ({ guide }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<GuideLayout>
|
<GuideLayout>
|
||||||
<GuideHeader guide={guide} />
|
<GuideHeader guide={ guide } />
|
||||||
<GuideBody>
|
<GuideBody>
|
||||||
<guide.component />
|
<guide.component />
|
||||||
<ShareGuide/>
|
<ShareGuide guide={ guide }/>
|
||||||
</GuideBody>
|
</GuideBody>
|
||||||
<GuideFooter guide={guide} />
|
<GuideFooter guide={ guide } />
|
||||||
</GuideLayout>
|
</GuideLayout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user