mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
Add Prettier Formatting (#258)
* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs * Remove trailing-comma as we are using Node 6 on Circle * Use latest Node 6 LTS version in Circle * Remove unused test
This commit is contained in:
parent
0cead4b6f9
commit
65421db62e
50 changed files with 1376 additions and 1350 deletions
|
@ -5,11 +5,11 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require("react");
|
||||
const classNames = require("classnames");
|
||||
const React = require('react');
|
||||
const classNames = require('classnames');
|
||||
|
||||
const siteConfig = require(process.cwd() + "/siteConfig.js");
|
||||
const translation = require("../../server/translation.js");
|
||||
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
||||
const translation = require('../../server/translation.js');
|
||||
|
||||
class SideNav extends React.Component {
|
||||
render() {
|
||||
|
@ -39,7 +39,7 @@ class SideNav extends React.Component {
|
|||
toggler.onclick = function() {
|
||||
nav.classList.toggle('docsSliderActive');
|
||||
};
|
||||
`
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</nav>
|
||||
|
@ -56,7 +56,7 @@ class SideNav extends React.Component {
|
|||
// return appropriately translated category string
|
||||
getLocalizedCategoryString(category) {
|
||||
let categoryString = translation[this.props.language]
|
||||
? translation[this.props.language]["localized-strings"][category] ||
|
||||
? translation[this.props.language]['localized-strings'][category] ||
|
||||
category
|
||||
: category;
|
||||
return categoryString;
|
||||
|
@ -69,12 +69,12 @@ class SideNav extends React.Component {
|
|||
|
||||
if (sbTitle) {
|
||||
localizedString = i18n
|
||||
? i18n["localized-strings"][sbTitle] || sbTitle
|
||||
? i18n['localized-strings'][sbTitle] || sbTitle
|
||||
: sbTitle;
|
||||
} else {
|
||||
const id = metadata.original_id || metadata.localized_id;
|
||||
localizedString = i18n
|
||||
? i18n["localized-strings"][id] || metadata.title
|
||||
? i18n['localized-strings'][id] || metadata.title
|
||||
: metadata.title;
|
||||
}
|
||||
return localizedString;
|
||||
|
@ -88,16 +88,16 @@ class SideNav extends React.Component {
|
|||
return siteConfig.baseUrl + metadata.permalink;
|
||||
}
|
||||
if (metadata.path) {
|
||||
return siteConfig.baseUrl + "blog/" + metadata.path;
|
||||
return siteConfig.baseUrl + 'blog/' + metadata.path;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
renderItemLink(link) {
|
||||
const itemClasses = classNames("navListItem", {
|
||||
navListItemActive: link.id === this.props.current.id
|
||||
const itemClasses = classNames('navListItem', {
|
||||
navListItemActive: link.id === this.props.current.id,
|
||||
});
|
||||
const linkClasses = classNames("navItem", {
|
||||
navItemActive: link.id === this.props.current.id
|
||||
const linkClasses = classNames('navItem', {
|
||||
navItemActive: link.id === this.props.current.id,
|
||||
});
|
||||
return (
|
||||
<li className={itemClasses} key={link.id}>
|
||||
|
@ -109,6 +109,6 @@ class SideNav extends React.Component {
|
|||
}
|
||||
}
|
||||
SideNav.defaultProps = {
|
||||
contents: []
|
||||
contents: [],
|
||||
};
|
||||
module.exports = SideNav;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue