prettier/website/core/Footer.js

93 lines
2.7 KiB
JavaScript
Raw Normal View History

"use strict";
const React = require("react");
2018-04-12 01:20:42 +03:00
const PropTypes = require("prop-types");
const GithubButton = props => (
<a
className="github-button"
href={props.config.githubUrl}
data-icon="octicon-star"
data-show-count="true"
aria-label="Star this project on GitHub"
>
Star
</a>
);
2018-04-12 01:20:42 +03:00
GithubButton.propTypes = {
config: PropTypes.object
};
class Footer extends React.Component {
url(path) {
2018-02-19 04:59:43 +03:00
const language = this.props.language || "en";
return `${this.props.config.baseUrl}docs/${language}${path}`;
}
usersUrl() {
const language = this.props.language || "en";
return `${this.props.config.baseUrl}${language}/users`;
}
render() {
return (
Revamp landing page (#3718) * Begin landing page revamp * Break the editor integrations onto their own lines * Add template string * Add editor line breaks * Make logo clickable * Add more docs links * Don’t split the editor list items into paragraphs * Break plugin onto its own line * Move the “Why” button to the bottom of the block * Use suggested font * Change font * Change footer color * Add assets from @orta * Fix fonts * Use new editor assets * Add npm/yarn button * Switch to npx * Minor mobile tweaks * Add dependants * Lots of zeros are cooler to look at than a “k” * Improve button sizes, respect prefers-reduced-motion * Fixup media breakpoints for Get Started section * Increase padding of editors * CSS fixes from code review * Prevent repeatedly clicking on the logo from selecting nearby text * dependant -> dependent * Various CSS tightening * Set flex-basis on editors * Add new languages panel * Improve layout of languages * Cleanup grouping code * Fix users layout * Fix language image widths * space-evenly -> space-between * Fix typo * Remove unused var * Various CSS fixes * Set overflow-x: auto on code * Improve languages layout * Add silly cursor * Make logo 'draggable' * [Site] Margins and paddings (#2) * [Site] Margins and paddings * [Site] Bring back the link to why, that's a good guide worth linking to * Improve logo mobile usage * Improve responsive layout of editors * Use static SVG for the moment (#3) * Use the static logo for the moment * Fix the broken JS, from going static, and make overscroll the right color * Fix padding
2018-02-06 12:52:39 +03:00
<footer className="footerSection 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>
2018-02-19 04:59:43 +03:00
<a href={this.usersUrl()}>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>
);
}
}
2018-04-12 01:20:42 +03:00
Footer.propTypes = {
language: PropTypes.string,
config: PropTypes.object
};
module.exports = Footer;