Skip to content

Commit

Permalink
fix(VerticalNavigation): collapse/expand icon
Browse files Browse the repository at this point in the history
  • Loading branch information
MEsteves22 committed Aug 1, 2023
1 parent 13a927d commit e299c4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ export const StyledGroup = styled("ul")({
export const StyledLabel = styled(
"div",
transientOptions
)(({ $expandable }: { $expandable: boolean }) => ({
)(({ $expandable, $hasIcon }: { $expandable: boolean; $hasIcon: boolean }) => ({
display: "flex",
flexGrow: 1,
maxWidth: "100%",
...($expandable && {
...(($hasIcon || $expandable) && {
maxWidth: "calc(100% - 32px)",
}),
...($expandable &&
$hasIcon && {
maxWidth: "calc(100% - 64px)",
}),
}));

export const StyledNode = styled("li")({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,11 @@ export const HvVerticalNavigationTreeViewItem = forwardRef(
/>

{isOpen && (
<StyledLabel $expandable={!!expandable}>{label}</StyledLabel>
<StyledLabel $hasIcon={useIcons} $expandable={!!expandable}>
{label}
</StyledLabel>
)}

{isOpen && expandable && (expanded ? <DropUpXS /> : <DropDownXS />)}
</StyledContent>
),
Expand Down

0 comments on commit e299c4a

Please sign in to comment.