mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 15:17:23 +02:00
Run Prettier
This commit is contained in:
parent
a7b5148e06
commit
fbae29b0ff
29 changed files with 1311 additions and 987 deletions
|
@ -7,16 +7,16 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
const React = require("react");
|
||||
|
||||
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
||||
const siteConfig = require(process.cwd() + "/siteConfig.js");
|
||||
|
||||
class LanguageDropDown extends React.Component {
|
||||
render() {
|
||||
const enabledLanguages = [];
|
||||
let currentLanguage = 'English';
|
||||
let currentLanguage = "English";
|
||||
|
||||
siteConfig['languages'].map(lang => {
|
||||
siteConfig["languages"].map(lang => {
|
||||
if (lang.tag == this.props.language) {
|
||||
currentLanguage = lang.name;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class LanguageDropDown extends React.Component {
|
|||
<a id="languages-menu" href="#">
|
||||
<img
|
||||
className="languages-icon"
|
||||
src={this.props.baseUrl + 'img/language.svg'}
|
||||
src={this.props.baseUrl + "img/language.svg"}
|
||||
/>
|
||||
{currentLanguage}
|
||||
</a>
|
||||
|
@ -70,7 +70,7 @@ class LanguageDropDown extends React.Component {
|
|||
languagesDropDown.className = "hide";
|
||||
}
|
||||
});
|
||||
`,
|
||||
`
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
|
@ -82,21 +82,24 @@ class HeaderNav extends React.Component {
|
|||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
slideoutActive: false,
|
||||
slideoutActive: false
|
||||
};
|
||||
}
|
||||
|
||||
makeLinks(link) {
|
||||
const linkWithLang = link.href.replace(
|
||||
/\/LANGUAGE\//,
|
||||
'\/' + this.props.language + '\/'
|
||||
"/" + this.props.language + "/"
|
||||
);
|
||||
return (
|
||||
<li key={link.section}>
|
||||
<a
|
||||
href={linkWithLang}
|
||||
className={link.section === this.props.section ? 'active' : ''}>
|
||||
{siteConfig[this.props.language] ? siteConfig[this.props.language]['localized-strings'][link.text] : link.text}
|
||||
className={link.section === this.props.section ? "active" : ""}
|
||||
>
|
||||
{siteConfig[this.props.language]
|
||||
? siteConfig[this.props.language]["localized-strings"][link.text]
|
||||
: link.text}
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
|
@ -109,7 +112,9 @@ class HeaderNav extends React.Component {
|
|||
<header>
|
||||
<a href={this.props.baseUrl}>
|
||||
<img src={this.props.baseUrl + siteConfig.headerIcon} />
|
||||
<h2>{this.props.title}</h2>
|
||||
<h2>
|
||||
{this.props.title}
|
||||
</h2>
|
||||
</a>
|
||||
{this.renderResponsiveNav()}
|
||||
</header>
|
||||
|
@ -130,9 +135,12 @@ class HeaderNav extends React.Component {
|
|||
/>
|
||||
{this.props.config.algolia &&
|
||||
<li className="navSearchWrapper reactNavSearchWrapper">
|
||||
<input id="search_input_react" type="text" placeholder="Search" />
|
||||
</li>
|
||||
}
|
||||
<input
|
||||
id="search_input_react"
|
||||
type="text"
|
||||
placeholder="Search"
|
||||
/>
|
||||
</li>}
|
||||
{this.props.config.headerLinksExternal.map(this.makeLinks, this)}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue