Footer.js 2.59 KB
Newer Older
1
/**
2
 * Copyright (c) Meta Platforms, Inc. and affiliates.
Patrick Labatut's avatar
Patrick Labatut committed
3
 * All rights reserved.
4
 *
Patrick Labatut's avatar
Patrick Labatut committed
5
6
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
7
 */
Patrick Labatut's avatar
Patrick Labatut committed
8

9
10
11
12
13
14
15
16
17
18
19
20
21
22
const PropTypes = require("prop-types");
const React = require('react');

function SocialFooter(props) {
  const repoUrl = `https://github.com/${props.config.organizationName}/${props.config.projectName}`;
  return (
    <div className="footerSection">
      <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"
23
          aria-label="Star PyTorch3D on GitHub"
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
        >
          {props.config.projectName}
        </a>
      </div>
    </div>
  );
}

SocialFooter.propTypes = {
  config: PropTypes.object
};

class Footer extends React.Component {
  docUrl(doc, language) {
    const baseUrl = this.props.config.baseUrl;
    const docsUrl = this.props.config.docsUrl;
    const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
    const langPart = `${language ? `${language}/` : ''}`;
    return `${baseUrl}${docsPart}${langPart}${doc}`;
  }

  pageUrl(doc, language) {
    const baseUrl = this.props.config.baseUrl;
    return baseUrl + (language ? `${language}/` : '') + doc;
  }

  render() {
    const repoUrl = `https://github.com/${this.props.config.organizationName}/${this.props.config.projectName}`;
    return (
      <footer className="nav-footer" id="footer">
        <section className="sitemap">
          <SocialFooter config={this.props.config} />
        </section>

        <a
          href="https://opensource.facebook.com/"
          target="_blank"
          rel="noreferrer noopener"
          className="fbOpenSource">
          <img
            src={`${this.props.config.baseUrl}img/oss_logo.png`}
            alt="Facebook Open Source"
            width="170"
            height="45"
          />
        </a>
Jeremy Reizenstein's avatar
Jeremy Reizenstein committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
        <section className="copyright">{this.props.config.copyright}
          <br/>
          Legal:
          <a
            href="https://opensource.facebook.com/legal/privacy/"
            target="_blank"
            rel="noreferrer noopener">
            Privacy
          </a>
          <a
            href="https://opensource.facebook.com/legal/terms/"
            target="_blank"
            rel="noreferrer noopener">
            Terms
          </a>
        </section>
86
87
88
89
90
91
      </footer>
    );
  }
}

module.exports = Footer;