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:
Sébastien Lorber 2021-07-08 20:26:55 +02:00 committed by GitHub
parent dc9f104ccc
commit f03479f69e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 6 deletions

View file

@ -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', {