mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 05:27:00 +02:00
Move Docusaurus 1 files into directory (#966)
* Move Docusaurus 1 into v1 directory * Update Circle CI commands for new v1 dir * Remove OC * Fix tests
This commit is contained in:
parent
9d4a5d5359
commit
f2927a9fc4
291 changed files with 7591 additions and 6532 deletions
35
v1/lib/core/DocsSidebar.js
Normal file
35
v1/lib/core/DocsSidebar.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* 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 React = require('react');
|
||||
const Container = require('./Container.js');
|
||||
const SideNav = require('./nav/SideNav.js');
|
||||
const readCategories = require('../server/readCategories.js');
|
||||
|
||||
class DocsSidebar extends React.Component {
|
||||
render() {
|
||||
const sidebar = this.props.metadata.sidebar;
|
||||
const 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;
|
Loading…
Add table
Add a link
Reference in a new issue