Skip to content

Commit

Permalink
- Move styling to CSS module, instead of locally in SidebarMenuCollap…
Browse files Browse the repository at this point in the history
…sible component.
  • Loading branch information
mattias800 committed Sep 7, 2023
1 parent 968747c commit bebe119
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ export const SidebarMenuCollapsible: React.FC<SidebarMenuCollapsibleProps> = ({
}) => {
const [expanded, setExpanded] = useState<boolean>(initialExpand);

const innerClassName = cx(
contentStyles.button,
expanded ? contentStyles.selected : undefined,
className
);

const innerStyle = {
height: "var(--swui-sidebar-menu-item-height)",
};

return (
<Box
background={"var(--current-background-color)"}
Expand All @@ -53,8 +43,11 @@ export const SidebarMenuCollapsible: React.FC<SidebarMenuCollapsibleProps> = ({
justifyContent={"space-between"}
>
<button
className={innerClassName}
style={innerStyle}
className={cx(
contentStyles.button,
expanded ? contentStyles.selected : undefined,
className
)}
onClick={() => setExpanded(!expanded)}
>
<Row justifyContent={"space-between"} indent={2}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
border: 0;
padding: 0;
background: var(--current-background-color);
height: var(--swui-sidebar-menu-item-height);

[data-collapsed] [aria-expanded="true"] &,
&:hover {
Expand Down

0 comments on commit bebe119

Please sign in to comment.