Files
developer-roadmap/components/guide-footer/index.js

84 lines
3.0 KiB
JavaScript
Raw Normal View History

2019-11-02 23:58:17 +04:00
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
2019-11-03 11:47:31 +04:00
import { faFacebookSquare, faGithub, faHackerNewsSquare, faRedditSquare, faTwitter, faTwitterSquare } from '@fortawesome/free-brands-svg-icons'
2019-11-06 22:56:57 +04:00
import { getContributionUrl } from "lib/guide";
import {
getTwitterUrl,
getTwitterShareUrl,
getFacebookShareUrl,
getRedditShareUrl,
getHnShareUrl
} from "lib/url";
import {
AuthorBio,
AuthorImg,
AuthorInfoWrap,
AuthorMeta,
ContributeIcon,
FooterBg,
FooterContainer,
FooterWrap,
ShareIcons,
ShareWrap
} from './style';
2019-11-02 23:58:17 +04:00
2019-11-06 22:10:25 +04:00
const GuideFooter = ({
guide,
guide: {
author = {}
} = {}
}) => (
2019-11-02 23:58:17 +04:00
<FooterWrap>
2019-11-03 11:47:31 +04:00
<FooterBg className="border-top">
<FooterContainer>
<ShareWrap>
<ContributeIcon>
2019-11-06 22:10:25 +04:00
<a href={ getContributionUrl(guide) } target="_blank">
2019-11-03 11:47:31 +04:00
<span className="d-none d-sm-none d-md-inline d-lg-inline d-xl-inline">Improve this Guide </span>
<span className="d-inline d-sm-inline d-md-none d-lg-none d-xl-none">Contribute </span>
<FontAwesomeIcon icon={faGithub}/>
</a>
</ContributeIcon>
<ContributeIcon hasMargins>
2019-11-06 22:56:57 +04:00
<a href={ getTwitterUrl(author.twitter) } target="_blank">
2019-11-03 11:47:31 +04:00
<span className="d-none d-sm-none d-md-inline d-lg-inline d-xl-inline">Follow the author </span>
<span className="d-inline d-sm-inline d-md-none d-lg-none d-xl-none">Author </span>
<FontAwesomeIcon icon={faTwitter}/>
</a>
</ContributeIcon>
<ShareIcons>
<span className="d-none d-sm-none d-md-none d-lg-inline d-xl-inline">Help spread the word</span>
<span className="d-inline d-sm-inline d-md-inline d-lg-none d-xl-none">Share</span>
2019-11-06 22:56:57 +04:00
<a href={ getTwitterShareUrl({ text: `${guide.title} by @${author.twitter}`, url: guide.url })} target="_blank">
<FontAwesomeIcon icon={faTwitterSquare}/>
</a>
<a href={ getFacebookShareUrl({ text: guide.title, url: guide.url }) } target="_blank">
<FontAwesomeIcon icon={faFacebookSquare}/>
</a>
<a href={ getRedditShareUrl({ text: guide.title, url: guide.url })} target="_blank">
<FontAwesomeIcon icon={faRedditSquare}/>
</a>
<a href={ getHnShareUrl({ text: guide.title, url: guide.url })} target="_blank">
<FontAwesomeIcon icon={faHackerNewsSquare}/>
</a>
2019-11-03 11:47:31 +04:00
</ShareIcons>
</ShareWrap>
</FooterContainer>
</FooterBg>
<FooterBg className="border-top">
<FooterContainer>
<AuthorInfoWrap>
2019-11-06 22:10:25 +04:00
<AuthorImg src={ author.picture } alt={ author.name }/>
2019-11-03 11:47:31 +04:00
<AuthorMeta>
2019-11-06 22:56:57 +04:00
<h4><a href={ getTwitterUrl(author.twitter) } target="_blank">{ author.name }</a></h4>
2019-11-06 22:10:25 +04:00
<AuthorBio>{ author.bio }</AuthorBio>
2019-11-03 11:47:31 +04:00
</AuthorMeta>
</AuthorInfoWrap>
</FooterContainer>
</FooterBg>
2019-11-02 23:58:17 +04:00
</FooterWrap>
);
2019-11-03 11:47:31 +04:00
export default GuideFooter;