"use strict";

const React = require("react");

const GithubButton = props => (
  <a
    className="github-button"
    href={props.config.githubUrl}
    data-icon="octicon-star"
    data-count-href={`/${props.config.repo}/stargazers`}
    data-count-api={`/repos/${props.config.repo}#stargazers_count`}
    data-count-aria-label="# stargazers on GitHub"
    aria-label="Star this project on GitHub"
  >
    Star
  </a>
);

GithubButton.propTypes = {
  config: React.PropTypes.object
};

class Footer extends React.Component {
  url(path) {
    return this.props.config.baseUrl + "docs/" + this.props.language + path;
  }

  render() {
    // const currentYear = new Date().getFullYear();
    return (
      <footer className="nav-footer" id="footer">
        <section className="sitemap">
          <a href={this.props.config.baseUrl} className="nav-home">
            <img
              src={this.props.config.baseUrl + this.props.config.footerIcon}
              alt={this.props.config.title}
            />
          </a>
          <div>
            <h5>Docs</h5>
            <a href={this.url("/index.html")}>About</a>
            <a href={this.url("/install.html")}>Usage</a>
          </div>
          <div>
            <h5>Community</h5>
            <a
              href={this.props.config.baseUrl + this.props.language + "/users/"}
            >
              User Showcase
            </a>
            <a
              href="http://stackoverflow.com/questions/tagged/prettier"
              target="_blank"
              rel="noopener noreferrer"
            >
              Stack Overflow
            </a>
            <a href="https://gitter.im/jlongster/prettier">Chat on Gitter</a>
            <a href="https://twitter.com/PrettierCode">
              @PrettierCode on Twitter
            </a>
            <object
              type="image/svg+xml"
              data="https://img.shields.io/twitter/follow/prettiercode.svg?label=Follow+Prettier&style=social"
            >
              <a href="https://twitter.com/intent/follow?screen_name=prettiercode">
                <img
                  alt="Follow Prettier on Twitter"
                  src="https://img.shields.io/twitter/follow/prettiercode.png?label=Follow+Prettier&style=social"
                />
              </a>
            </object>
          </div>
          <div>
            <h5>More</h5>
            <a href={this.props.config.baseUrl + "blog"}>Blog</a>
            <a href={this.props.config.githubUrl}>GitHub</a>
            <a href={this.props.config.githubUrl + "/issues"}>Issues</a>
            <GithubButton config={this.props.config} />
          </div>
        </section>
      </footer>
    );
  }
}

Footer.propTypes = {
  language: React.PropTypes.string,
  config: React.PropTypes.object
};

module.exports = Footer;

@@ -184,173 +184,24 @@
 ata-
-count-href=%7B%60/$%7Bprops.config.repo%7D/stargazers%60%7D%0A    data-count-api=%7B%60/repos/$%7Bprops.config.repo%7D#stargazers_count%60%7D%0A    data-count-aria-label=%22# stargazers on GitHub
+show-count=%22true
 %22%0A  

Fix deprecation warning from Github Buttons on website (#3783)