Skip to content

Commit

Permalink
Merge pull request #24 from Bandwidth/tags
Browse files Browse the repository at this point in the history
Update Tag Groups to be Collapsible
  • Loading branch information
ckoegel authored Jun 7, 2023
2 parents 05a8571 + 9b8e473 commit 4f6935b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/SideMenu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
{item.sidebarLabel}
{this.props.children}
</MenuItemTitle>
{(item.depth > 0 && item.items.length > 0 && (
{(item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
)) ||
null}
Expand Down
8 changes: 2 additions & 6 deletions src/services/models/Group.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export class GroupModel implements IMenuItem {
this.parent = parent;
this.externalDocs = (tagOrGroup as OpenAPITag).externalDocs;

// groups are active (expanded) by default
// groups are active but not expanded by default
if (this.type === 'group') {
this.expanded = true;
this.active = true;
}
}

Expand All @@ -77,10 +77,6 @@ export class GroupModel implements IMenuItem {

@action
collapse() {
// disallow collapsing groups
if (this.type === 'group') {
return;
}
this.expanded = false;
}

Expand Down

0 comments on commit 4f6935b

Please sign in to comment.