mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-22 19:17:46 +02:00
test(v2): dogfooding: add huge sidebar for testing purposes (#5130)
* dogfoog: add huge sidebar for testing purposes * Add standalone doc + build-size tracking
This commit is contained in:
parent
dc9f104ccc
commit
f03479f69e
5 changed files with 59 additions and 6 deletions
|
@ -58,9 +58,13 @@ const DocSidebarItems = memo(function DocSidebarItems({
|
|||
));
|
||||
});
|
||||
|
||||
function DocSidebarItem(props): JSX.Element {
|
||||
function DocSidebarItem(props): JSX.Element | null {
|
||||
switch (props.item.type) {
|
||||
case 'category':
|
||||
// Never render empty categories
|
||||
if (props.item.items.length === 0) {
|
||||
return null;
|
||||
}
|
||||
return <DocSidebarItemCategory {...props} />;
|
||||
case 'link':
|
||||
default:
|
||||
|
@ -104,10 +108,6 @@ function DocSidebarItemCategory({
|
|||
}
|
||||
}, [isActive, wasActive, collapsed]);
|
||||
|
||||
if (items.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<li
|
||||
className={clsx('menu__list-item', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue