feat(v2): allow non sidebar category to be first item of sidebar (#2032)

* feat(v2): allow non sidebar category to be first item of sidebar

* better error messages

* edit the react component

* Update website/docs/sidebar.md

* nits

* add @babel/plugin-transform-runtime
This commit is contained in:
Endi 2019-11-24 11:08:19 +07:00 committed by Yangshun Tay
parent c533adc4aa
commit 9862a6821a
20 changed files with 849 additions and 671 deletions

View file

@ -171,19 +171,16 @@ function DocSidebar(props) {
)}
</button>
<ul className="menu__list">
{sidebarData.map(
item =>
item.items.length > 0 && (
<DocSidebarItem
key={item.label}
item={item}
onItemClick={() => {
setShowResponsiveSidebar(false);
}}
collapsible={sidebarCollapsible}
/>
),
)}
{sidebarData.map(item => (
<DocSidebarItem
key={item.label}
item={item}
onItemClick={() => {
setShowResponsiveSidebar(false);
}}
collapsible={sidebarCollapsible}
/>
))}
</ul>
</div>
</div>