Merge pull request #24 from Bandwidth/tags

Update Tag Groups to be Collapsible
This commit is contained in:
Cameron Koegel 2023-06-07 16:43:12 -04:00 committed by GitHub
commit 4f6935bce8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -53,7 +53,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
{item.sidebarLabel} {item.sidebarLabel}
{this.props.children} {this.props.children}
</MenuItemTitle> </MenuItemTitle>
{(item.depth > 0 && item.items.length > 0 && ( {(item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} /> <ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
)) || )) ||
null} null}

View File

@ -56,9 +56,9 @@ export class GroupModel implements IMenuItem {
this.parent = parent; this.parent = parent;
this.externalDocs = (tagOrGroup as OpenAPITag).externalDocs; this.externalDocs = (tagOrGroup as OpenAPITag).externalDocs;
// groups are active (expanded) by default // groups are active but not expanded by default
if (this.type === 'group') { if (this.type === 'group') {
this.expanded = true; this.active = true;
} }
} }
@ -77,10 +77,6 @@ export class GroupModel implements IMenuItem {
@action @action
collapse() { collapse() {
// disallow collapsing groups
if (this.type === 'group') {
return;
}
this.expanded = false; this.expanded = false;
} }