Skip to content

Commit

Permalink
fix: don't collapse the blog navigation even if collapsible is true (f…
Browse files Browse the repository at this point in the history
…acebook#1519)

* fix: don't collapse the blog navigation even if collapsible is true

* fix: read docsSideNavCollapsible from props
  • Loading branch information
yangshun authored and tusharf5 committed May 27, 2019
1 parent 8b77ccb commit 7e2b3c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/docusaurus-1.x/lib/core/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ class DocsLayout extends React.Component {
version={metadata.version}
metadata={metadata}>
<div className="docMainWrapper wrapper">
<DocsSidebar metadata={metadata} />
<DocsSidebar
collapsible={this.props.config.docsSideNavCollapsible}
metadata={metadata}
/>
<Container className="mainContainer">
<DocComponent
metadata={metadata}
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-1.x/lib/core/DocsSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const fs = require('fs');
const Container = require('./Container.js');
const SideNav = require('./nav/SideNav.js');
const Metadata = require('../core/metadata.js');

const readCategories = require('../server/readCategories.js');

let languages;
Expand Down Expand Up @@ -39,6 +40,7 @@ class DocsSidebar extends React.Component {
return (
<Container className="docsNavContainer" id="docsNav" wrapper={false}>
<SideNav
collapsible={this.props.collapsible}
language={this.props.metadata.language}
root={this.props.root}
title={this.props.title}
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-1.x/lib/core/nav/SideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SideNav extends React.Component {
let categoryClassName = 'navGroupCategoryTitle';
let arrow;

if (siteConfig.docsSideNavCollapsible) {
if (this.props.collapsible) {
categoryClassName += ' collapsible';
ulClassName = 'hide';
arrow = (
Expand Down Expand Up @@ -227,6 +227,7 @@ class SideNav extends React.Component {
}

SideNav.defaultProps = {
collapsible: false,
contents: [],
};

Expand Down

0 comments on commit 7e2b3c7

Please sign in to comment.