unity-atoms/website/core/Footer.js

88 lines
2.6 KiB
JavaScript
Raw Normal View History

2019-10-03 19:37:30 -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.
*/
const React = require('react');
class Footer extends React.Component {
docUrl(doc, language) {
2019-10-07 14:54:17 -04:00
const { config } = this.props;
const { baseUrl, docsUrl } = config;
2019-10-03 19:37:30 -04:00
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
const langPart = `${language ? `${language}/` : ''}`;
return `${baseUrl}${docsPart}${langPart}${doc}`;
}
pageUrl(doc, language) {
2019-10-07 14:54:17 -04:00
const { config } = this.props;
const { baseUrl } = config;
2019-10-03 19:37:30 -04:00
return baseUrl + (language ? `${language}/` : '') + doc;
}
render() {
2019-10-07 14:54:17 -04:00
const { config } = this.props;
const { baseUrl, footerIcon, title, repoUrl, copyright } = config;
2019-10-03 19:37:30 -04:00
return (
<footer className="nav-footer" id="footer">
<section className="sitemap">
2019-10-07 14:54:17 -04:00
<a href={baseUrl} className="nav-home">
{footerIcon && (
2019-10-03 19:37:30 -04:00
<img
2019-10-07 14:54:17 -04:00
src={baseUrl + footerIcon}
alt={title}
2019-10-03 19:37:30 -04:00
style={{ width: '52px', height: '52px' }}
/>
)}
</a>
<div>
<h5>Docs</h5>
2019-10-07 14:54:17 -04:00
<a href={this.docUrl('introduction/quick-start')}>Quick Start</a>
<a href={this.docUrl('api/actions')}>API</a>
2020-03-02 14:12:38 -05:00
<a href={this.docUrl('subpackages/base-atoms')}>Subpackages</a>
2019-10-03 19:37:30 -04:00
</div>
<div>
<h5>Community</h5>
2019-11-03 11:50:45 -05:00
<a
href="https://discord.gg/W4yd7E7"
target="_blank"
rel="noreferrer noopener"
>
2020-03-02 14:12:38 -05:00
Discord
2019-11-03 11:50:45 -05:00
</a>
2019-10-03 19:37:30 -04:00
<a
href="https://gitter.im/unity-atoms/community#"
target="_blank"
2019-10-07 14:54:17 -04:00
rel="noreferrer noopener"
>
2019-10-03 19:37:30 -04:00
Gitter
</a>
</div>
<div>
<h5>More</h5>
<a href="https://medium.com/@adamramberg">Blog</a>
<a href="https://github.com/AdamRamberg/unity-atoms">GitHub</a>
<a
className="github-button"
2019-10-07 14:54:17 -04:00
href={repoUrl}
2019-10-03 19:37:30 -04:00
data-icon="octicon-star"
data-count-href="/AdamRamberg/unity-atoms/stargazers"
data-show-count="true"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub"
>
Star
</a>
</div>
</section>
2019-10-07 14:54:17 -04:00
<section className="copyright">{copyright}</section>
2019-10-03 19:37:30 -04:00
</footer>
);
}
}
module.exports = Footer;