/ website / core / Footer.js
Footer.js
  1  /**
  2   * Copyright (c) 2017-present, Facebook, Inc.
  3   *
  4   * This source code is licensed under the MIT license found in the
  5   * LICENSE file in the root directory of this source tree.
  6   */
  7  
  8  const React = require('react');
  9  
 10  class Footer extends React.Component {
 11    docUrl(doc, language) {
 12      const baseUrl = this.props.config.baseUrl;
 13      return baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
 14    }
 15  
 16    pageUrl(doc, language) {
 17      const baseUrl = this.props.config.baseUrl;
 18      return baseUrl + (language ? language + '/' : '') + doc;
 19    }
 20  
 21    render() {
 22      const currentYear = new Date().getFullYear();
 23      return (
 24        <footer className="nav-footer" id="footer">
 25          <section className="sitemap">
 26            <a href={this.props.config.baseUrl} className="nav-home">
 27              {this.props.config.footerIcon && (
 28                <img
 29                  src={this.props.config.baseUrl + this.props.config.footerIcon}
 30                  alt={this.props.config.title}
 31                  width="66"
 32                  height="58"
 33                />
 34              )}
 35            </a>
 36            <div>
 37              <h5>Docs</h5>
 38              <a href={this.docUrl('doc1.html', this.props.language)}>
 39                Getting Started (or other categories)
 40              </a>
 41              <a href={this.docUrl('doc2.html', this.props.language)}>
 42                Guides (or other categories)
 43              </a>
 44              <a href={this.docUrl('doc3.html', this.props.language)}>
 45                API Reference (or other categories)
 46              </a>
 47            </div>
 48            <div>
 49              <h5>Community</h5>
 50              <a href={this.pageUrl('users.html', this.props.language)}>
 51                User Showcase
 52              </a>
 53              <a
 54                href="http://stackoverflow.com/questions/tagged/"
 55                target="_blank"
 56                rel="noreferrer noopener">
 57                Stack Overflow
 58              </a>
 59              <a href="https://discordapp.com/">Project Chat</a>
 60              <a
 61                href="https://twitter.com/"
 62                target="_blank"
 63                rel="noreferrer noopener">
 64                Twitter
 65              </a>
 66            </div>
 67            <div>
 68              <h5>More</h5>
 69              <a href={this.props.config.baseUrl + 'blog'}>Blog</a>
 70              <a href="https://github.com/">GitHub</a>
 71              <a
 72                className="github-button"
 73                href={this.props.config.repoUrl}
 74                data-icon="octicon-star"
 75                data-count-href="/facebook/docusaurus/stargazers"
 76                data-show-count={true}
 77                data-count-aria-label="# stargazers on GitHub"
 78                aria-label="Star this project on GitHub">
 79                Star
 80              </a>
 81            </div>
 82          </section>
 83  
 84          <a
 85            href="https://code.facebook.com/projects/"
 86            target="_blank"
 87            rel="noreferrer noopener"
 88            className="fbOpenSource">
 89            <img
 90              src={this.props.config.baseUrl + 'img/oss_logo.png'}
 91              alt="Facebook Open Source"
 92              width="170"
 93              height="45"
 94            />
 95          </a>
 96          <section className="copyright">{this.props.config.copyright}</section>
 97        </footer>
 98      );
 99    }
100  }
101  
102  module.exports = Footer;