docusaurus/website/core/Footer.js

138 lines
3.8 KiB
JavaScript
Raw Normal View History

2017-07-27 19:15:47 -04:00
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
2017-07-27 19:15:47 -04:00
*/
const PropTypes = require('prop-types');
const React = require('react');
2017-07-27 19:15:47 -04:00
function SocialFooter(props) {
const repoUrl = `https://github.com/${props.config.organizationName}/${
props.config.projectName
}`;
return (
<div className="footerSection">
<h5>Social</h5>
<div className="social">
<a
className="github-button" // part of the https://buttons.github.io/buttons.js script in siteConfig.js
href={repoUrl}
data-count-href={`${repoUrl}/stargazers`}
data-show-count="true"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub">
{props.config.projectName}
</a>
</div>
{props.config.twitterUsername && (
<div className="social">
<a
href={`https://twitter.com/${props.config.twitterUsername}`}
className="twitter-follow-button">
Follow @{props.config.twitterUsername}
</a>
</div>
)}
{props.config.facebookAppId && (
<div className="social">
<div
className="fb-like"
data-href={props.config.url}
data-layout="standard"
data-share="true"
data-width="225"
data-show-faces="false"
/>
</div>
)}
</div>
);
}
2017-12-11 19:15:26 -05:00
SocialFooter.propTypes = {
config: PropTypes.object,
2017-12-11 19:15:26 -05:00
};
2017-07-27 19:15:47 -04:00
class Footer extends React.Component {
render() {
return (
<footer className="nav-footer" id="footer">
<section className="sitemap">
2017-12-27 10:40:38 -05:00
{this.props.config.footerIcon && (
<a href={this.props.config.baseUrl} className="nav-home">
<img
src={`${this.props.config.baseUrl}${
this.props.config.footerIcon
}`}
2017-12-27 10:40:38 -05:00
alt={this.props.config.title}
width="66"
height="58"
/>
</a>
)}
<div className="footerSection">
2017-07-27 19:15:47 -04:00
<h5>Docs</h5>
<a
href={`
${this.props.config.baseUrl}docs/${
this.props.language
}/installation`}>
2017-07-27 19:15:47 -04:00
Getting Started
</a>
2017-12-11 19:15:26 -05:00
<a
href={`
${this.props.config.baseUrl}docs/${
this.props.language
}/versioning`}>
2017-12-11 19:15:26 -05:00
Versioning
</a>
<a
href={`
${this.props.config.baseUrl}docs/${
this.props.language
}/translation`}>
2017-12-11 19:15:26 -05:00
Localization
</a>
<a
href={`
${this.props.config.baseUrl}docs/${
this.props.language
}/search`}>
2017-12-11 19:15:26 -05:00
Adding Search
</a>
2017-07-27 19:15:47 -04:00
</div>
<div className="footerSection">
2017-07-27 19:15:47 -04:00
<h5>Community</h5>
<a
href={`${this.props.config.baseUrl}${this.props.language}/users`}>
2017-07-27 19:15:47 -04:00
User Showcase
</a>
</div>
<SocialFooter config={this.props.config} />
2017-07-27 19:15:47 -04:00
</section>
<a
href="https://code.facebook.com/projects/"
target="_blank"
rel="noreferrer noopener"
className="fbOpenSource">
2017-07-27 19:15:47 -04:00
<img
src={`${this.props.config.baseUrl}img/oss_logo.png`}
2017-07-27 19:15:47 -04:00
alt="Facebook Open Source"
width="170"
height="45"
/>
</a>
<section className="copyright">
{this.props.config.copyright && (
<span>{this.props.config.copyright}</span>
)}
2017-07-27 19:15:47 -04:00
</section>
</footer>
);
}
}
module.exports = Footer;