diff --git a/src/chrome/mainsidebar/MainSidebar2.tsx b/src/chrome/mainsidebar/MainSidebar2.tsx index e24a479c0..2c824a0ef 100644 --- a/src/chrome/mainsidebar/MainSidebar2.tsx +++ b/src/chrome/mainsidebar/MainSidebar2.tsx @@ -69,7 +69,8 @@ type SectionLevel = 1 | 2 | 3; const SidebarSectionButton = styled('button')<{ level: SectionLevel; color: string; -}>(({level, color}) => ({ + collapsed: boolean; +}>(({level, color, collapsed}) => ({ fontWeight: level === 3 ? 'normal' : 'bold', borderRadius: 0, border: 'none', @@ -86,13 +87,15 @@ const SidebarSectionButton = styled('button')<{ const SidebarSectionBody = styled('div')<{ level: SectionLevel; collapsed: boolean; -}>(({collapsed}) => ({ +}>(({collapsed, level}) => ({ flexShrink: 0, overflow: 'hidden', maxHeight: collapsed ? 0 : 2000, // might need increase if too many plugins... transition: collapsed ? 'max-height 0.3s ease-out' : 'max-height 0.5s ease-in', + borderBottom: + level === 2 ? `1px solid ${colors.sectionHeaderBorder}` : undefined, })); const SidebarSection: React.FC<{ @@ -109,7 +112,8 @@ const SidebarSection: React.FC<{ setCollapsed(s => !s)} level={level} - color={color}> + color={color} + collapsed={collapsed}> {typeof title === 'function' ? title(collapsed) : title} {level < 3 && children && ( @@ -122,7 +126,6 @@ const SidebarSection: React.FC<{ - {level === 1 &&
} {children}