Skip to content

Commit 85c1797

Browse files
committed
frontend: SidebarItem: Remove styles that were moved to LinkItem
Signed-off-by: Oleksandr Dubenko <[email protected]>
1 parent 256f482 commit 85c1797

File tree

1 file changed

+2
-121
lines changed

1 file changed

+2
-121
lines changed

frontend/src/components/Sidebar/SidebarItem.tsx

Lines changed: 2 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Collapse from '@mui/material/Collapse';
22
import List from '@mui/material/List';
33
import ListItem, { ListItemProps } from '@mui/material/ListItem';
4-
import { useTheme } from '@mui/system';
54
import React, { memo } from 'react';
65
import { generatePath } from 'react-router';
76
import { useCluster } from '../../lib/k8s';
@@ -44,12 +43,8 @@ const SidebarItem = memo((props: SidebarItemProps) => {
4443
hide,
4544
...other
4645
} = props;
47-
const hasSubtitle = !!subtitle;
48-
const theme = useTheme();
4946
const cluster = useCluster();
5047

51-
// const classes = useItemStyle({ fullWidth, hasSubtitle: !!subtitle });
52-
5348
let fullURL = url;
5449
if (fullURL && useClusterURL && cluster) {
5550
fullURL = generatePath(getClusterPrefixedPath(url), { cluster });
@@ -69,127 +64,13 @@ const SidebarItem = memo((props: SidebarItemProps) => {
6964
selected={isSelected}
7065
pathname={fullURL || ''}
7166
primary={fullWidth ? label : ''}
72-
containerProps={{
73-
sx: {
74-
color: theme.palette.sidebarLink.color,
75-
borderRadius: '4px',
76-
marginRight: '5px',
77-
marginLeft: theme.spacing(5),
78-
marginBottom: '1px',
79-
80-
'& *': {
81-
fontSize: '.875rem',
82-
textTransform: 'none',
83-
},
84-
'& .MuiListItem-root': {
85-
paddingTop: '4px',
86-
paddingBottom: '4px',
87-
},
88-
'& .MuiListItem-button:hover': {
89-
backgroundColor: 'unset',
90-
},
91-
'&:hover': {
92-
backgroundColor: theme.palette.sidebarLink.hover.backgroundColor,
93-
94-
'& svg': {
95-
color: theme.palette.sidebarLink.hover.color,
96-
},
97-
},
98-
'& a.Mui-focusVisible': {
99-
backgroundColor: theme.palette.sidebarLink.hover.backgroundColor,
100-
},
101-
'& svg': {
102-
color: theme.palette.sidebarLink.color,
103-
},
104-
'& .MuiListItemIcon-root': {
105-
minWidth: 0,
106-
alignSelf: fullWidth && hasSubtitle ? 'stretch' : 'auto',
107-
paddingTop: fullWidth && hasSubtitle ? theme.spacing(1) : 0,
108-
marginRight: fullWidth ? '8px' : '0',
109-
},
110-
'& .MuiListItemText-secondary': {
111-
fontSize: '.85rem',
112-
fontStyle: 'italic',
113-
whiteSpace: 'nowrap',
114-
textOverflow: 'ellipsis',
115-
overflowWrap: 'anywhere',
116-
overflow: 'hidden',
117-
color: theme.palette.sidebarLink.color,
118-
},
119-
120-
...(!hasParent && {
121-
color: theme.palette.sidebarLink.main.color,
122-
marginLeft: '5px',
123-
marginRight: '5px',
124-
borderRadius: '4px',
125-
126-
'& .MuiListItem-root': {
127-
paddingTop: hasSubtitle ? '0' : '7px',
128-
paddingBottom: hasSubtitle ? '0' : '7px',
129-
paddingLeft: '19px',
130-
minHeight: !fullWidth ? '56px' : 'unset',
131-
},
132-
133-
'& *': {
134-
fontSize: '1rem',
135-
},
136-
137-
'&:hover, &:active': {
138-
color: theme.palette.sidebarLink.main.color,
139-
'& svg': {
140-
color: theme.palette.sidebarLink.main.color,
141-
},
142-
},
143-
}),
144-
145-
...(!hasParent &&
146-
isSelected && {
147-
'& svg': {
148-
color: theme.palette.sidebarLink.main.selected.color,
149-
},
150-
'&:hover, &:active': {
151-
color: theme.palette.sidebarLink.main.selected.color,
152-
'& svg': {
153-
color: theme.palette.sidebarLink.main.selected.color,
154-
},
155-
},
156-
'&, & *': {
157-
color: theme.palette.sidebarLink.main.selected.color,
158-
},
159-
backgroundColor: `${theme.palette.sidebarLink.main.selected.backgroundColor}!important`,
160-
'& .MuiListItemText-secondary': {
161-
fontSize: '.85rem',
162-
fontStyle: 'italic',
163-
whiteSpace: 'nowrap',
164-
textOverflow: 'ellipsis',
165-
textTransform: 'none',
166-
overflowWrap: 'anywhere',
167-
overflow: 'hidden',
168-
color: theme.palette.sidebarLink.main.selected.color,
169-
},
170-
'& a.Mui-focusVisible': {
171-
backgroundColor: theme.palette.sidebarLink.selected.backgroundColor,
172-
},
173-
}),
174-
175-
...(hasParent &&
176-
isSelected && {
177-
fontWeight: 'bold',
178-
'& .Mui-selected': {
179-
background: theme.palette.sidebarLink.selected.backgroundColor,
180-
'& *': {
181-
fontWeight: 'bold',
182-
color: theme.palette.sidebarLink.selected.color,
183-
},
184-
},
185-
}),
186-
},
187-
}}
18867
icon={icon}
18968
name={label}
19069
subtitle={subtitle}
19170
search={search}
19271
iconOnly={!fullWidth}
72+
hasParent={hasParent}
73+
fullWidth={fullWidth}
19374
{...other}
19475
/>
19576
{subList.length > 0 && (

0 commit comments

Comments
 (0)