Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

72 rader
2.1 KiB

  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. docUrl(doc, language) {
  10. const baseUrl = this.props.config.baseUrl;
  11. const docsUrl = this.props.config.docsUrl;
  12. const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
  13. const langPart = `${language ? `${language}/` : ''}`;
  14. return `${baseUrl}${docsPart}${langPart}${doc}`;
  15. }
  16. pageUrl(doc, language) {
  17. const baseUrl = this.props.config.baseUrl;
  18. return baseUrl + (language ? `${language}/` : '') + doc;
  19. }
  20. render() {
  21. return (
  22. <footer className="nav-footer" id="footer">
  23. <section className="sitemap">
  24. <a href={this.props.config.baseUrl} className="nav-home">
  25. {this.props.config.footerIcon && (
  26. <img
  27. src={this.props.config.baseUrl + this.props.config.footerIcon}
  28. alt={this.props.config.title}
  29. width="66"
  30. height="58"
  31. />
  32. )}
  33. </a>
  34. <div>
  35. <h5>Docs</h5>
  36. <a href={this.docUrl('getting-started/installation')}>
  37. Getting Started
  38. </a>
  39. <a href={this.docUrl('guides/diagram')}>
  40. Guides
  41. </a>
  42. <a href={this.docUrl('nodes/aws')}>
  43. Nodes
  44. </a>
  45. </div>
  46. <div>
  47. <h5>More</h5>
  48. <a href="https://github.com/mingrammer/diagrams">GitHub</a>
  49. <a
  50. className="github-button"
  51. href={this.props.config.repoUrl}
  52. data-icon="octicon-star"
  53. data-count-href="/mingrammer/diagrams/stargazers"
  54. data-show-count="true"
  55. data-count-aria-label="# stargazers on GitHub"
  56. aria-label="Star this project on GitHub">
  57. Star
  58. </a>
  59. </div>
  60. </section>
  61. <section className="copyright">{this.props.config.copyright}</section>
  62. </footer>
  63. );
  64. }
  65. }
  66. module.exports = Footer;