mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 18:58:36 +02:00
* 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
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
const Metadata = require('./metadata.js');
|
|
const React = require('react');
|
|
const Container = require('./Container.js');
|
|
const SideNav = require('./nav/SideNav.js');
|
|
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
|
const readCategories = require('../server/readCategories.js');
|
|
|
|
class DocsSidebar extends React.Component {
|
|
render() {
|
|
let sidebar = this.props.metadata.sidebar;
|
|
let docsCategories = readCategories(sidebar);
|
|
const categoryName = docsCategories[this.props.metadata.language][0].name;
|
|
if (!categoryName) {
|
|
return null;
|
|
}
|
|
return (
|
|
<Container className="docsNavContainer" id="docsNav" wrapper={false}>
|
|
<SideNav
|
|
language={this.props.metadata.language}
|
|
root={this.props.root}
|
|
title={this.props.title}
|
|
contents={docsCategories[this.props.metadata.language]}
|
|
current={this.props.metadata}
|
|
/>
|
|
</Container>
|
|
);
|
|
}
|
|
}
|
|
|
|
module.exports = DocsSidebar;
|