Skip to content

Commit eaa0847

Browse files
authored
Hide ListItemText when sidenav is condensed (#278)
1 parent 061cde2 commit eaa0847

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/components/SideNav/SideNav.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ export const MODE = {
1919
HIDDEN: 'hidden'
2020
};
2121

22-
const Container = styled(Drawer)`
23-
width: 0;
24-
width: ${({ condensed }) =>
25-
condensed ? COLLAPSED_NAV_WIDTH : FULL_NAV_WIDTH}px;
26-
transition: width 0.3s ease-out;
27-
`;
28-
2922
const getDrawerContentStyles = ({ mode }) => css`
3023
width: ${mode === MODE.CONDENSED ? COLLAPSED_NAV_WIDTH : FULL_NAV_WIDTH}px;
3124
overflow: hidden;
@@ -51,6 +44,17 @@ const NavListItem = styled(({ icon, children, ...rest }) => (
5144
}
5245
`;
5346

47+
const Container = styled(Drawer)`
48+
${({ condensed }) => css`
49+
width: 0;
50+
width: ${condensed ? COLLAPSED_NAV_WIDTH : FULL_NAV_WIDTH}px;
51+
transition: width 0.3s ease-out;
52+
${ListItemText} {
53+
${condensed && 'display: none'};
54+
}
55+
`};
56+
`;
57+
5458
const NavList = styled(List)`
5559
user-select: none;
5660
-ms-overflow-style: none;

0 commit comments

Comments
 (0)