Footer.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. const React = require('react');
  8. class Footer extends React.Component {
  9. get repoUrl() {
  10. const { config: { repoPath } } = this.props;
  11. return `https://github.com/${repoPath}`;
  12. }
  13. docUrl(doc) {
  14. const baseUrl = this.props.config.baseUrl;
  15. return baseUrl + 'docs/' + doc;
  16. }
  17. render() {
  18. const { config } = this.props;
  19. const currentYear = new Date().getFullYear();
  20. return (
  21. <footer className="nav-footer" id="footer">
  22. <section className="sitemap">
  23. <a href={config.baseUrl} className="nav-home">
  24. {config.footerIcon && (
  25. <img
  26. src={config.baseUrl + config.footerIcon}
  27. alt={config.title}
  28. width="66"
  29. height="58"
  30. />
  31. )}
  32. </a>
  33. <div>
  34. <h5>Docs</h5>
  35. <a href={this.docUrl('index.html', this.props.language)}>
  36. Getting Started
  37. </a>
  38. <a href={this.docUrl('check-api.html', this.props.language)}>
  39. API Reference
  40. </a>
  41. </div>
  42. <div>
  43. <h5>Community</h5>
  44. <a
  45. href="http://stackoverflow.com/questions/tagged/express-validator"
  46. target="_blank"
  47. rel="noreferrer noopener">
  48. Stack Overflow
  49. </a>
  50. </div>
  51. <div>
  52. <h5>More</h5>
  53. <a href={this.repoUrl}>GitHub</a>
  54. <a
  55. className="github-button"
  56. href={this.repoUrl}
  57. data-icon="octicon-star"
  58. data-count-href="/express-validator/express-validator/stargazers"
  59. data-show-count={true}
  60. data-count-aria-label="# stargazers on GitHub"
  61. aria-label="Star this project on GitHub">
  62. Star
  63. </a>
  64. </div>
  65. </section>
  66. <section className="copyright">{config.copyright}</section>
  67. </footer>
  68. );
  69. }
  70. }
  71. module.exports = Footer;