feat: colors for sidebar

This commit is contained in:
Caio Cabral committed 2025-01-12 08:19:29 -05:00
1 parent 5fcc87dab4
commit 46af783ce6
1 file changed
+35 -15
+35 -15
View File
@@ -166,29 +166,46 @@ function Sidebar() {
/* TODO general padding should be here */ /* TODO general padding should be here */
py={theme.spacing(6)} py={theme.spacing(6)}
gap={theme.spacing(6)} gap={theme.spacing(6)}
/* TODO set all style in this sx if possible (when general)
This is the top lever for styles
*/
sx={{ sx={{
border: 1, border: 1,
borderColor: theme.palette.primary.lowContrast, borderColor: theme.palette.primary.lowContrast,
borderRadius: theme.shape.borderRadius, borderRadius: theme.shape.borderRadius,
/* TODO selected item */ "& :is(p, span, .MuiListSubheader-root)": {
"& .selected-path": { /*
/* TODO lookup theme.palette.tertiary.main */ Text color for unselected menu items and menu headings
backgroundColor: theme.palette.secondary.main /* theme.palette.tertiary.main */, Secondary contrast text against main background
*/
/* TODO not working */ color: theme.palette.primary.contrastText.secondary,
color: theme.palette.primary.main,
},
" & .MuiListItemButton-root:hover": {
backgroundColor: theme.palette.tertiary.main,
/* TODO try and change color */
color: theme.palette.secondary.main,
}, },
"& .MuiList-root svg path": { "& .MuiList-root svg path": {
/* Menu Icons */ /* Menu Icons */
stroke: iconColor, stroke: iconColor,
}, },
"& p, & span, & .MuiListSubheader-root": { "& .selected-path": {
color: theme.palette.primary.contrastText.secondary, /* Selected menu item */
backgroundColor: theme.palette.secondary.main,
"& .MuiListItemIcon-root svg path": {
/* Selected menu item icon */
stroke: theme.palette.secondary.contrastText,
},
"& .MuiListItemText-root :is(p, span)": {
/* Selected menu item text */
color: theme.palette.secondary.contrastText,
},
},
"& .MuiListItemButton-root": {
transition: "background-color .3s",
" &:hover": {
/* Hovered menu item bg color */
backgroundColor: theme.palette.tertiary.main,
"& :is(p, span)": {
/* Hovered menu item text color */
color: theme.palette.tertiary.contrastText,
},
},
}, },
}} }}
> >
@@ -207,6 +224,7 @@ function Sidebar() {
width: theme.spacing(8), width: theme.spacing(8),
height: theme.spacing(8), height: theme.spacing(8),
"& path": { "& path": {
/* TODO this should be set at the top level if possible */
stroke: theme.palette.primary.contrastText.secondary, stroke: theme.palette.primary.contrastText.secondary,
}, },
}, },
@@ -294,6 +312,7 @@ function Sidebar() {
> >
{menu.map((item) => {menu.map((item) =>
item.path ? ( item.path ? (
/* If item has a path */
<Tooltip <Tooltip
key={item.path} key={item.path}
placement="right" placement="right"
@@ -329,7 +348,7 @@ function Sidebar() {
</ListItemButton> </ListItemButton>
</Tooltip> </Tooltip>
) : collapsed ? ( ) : collapsed ? (
/* TODO Do we ever get here? */ /* TODO Do we ever get here? If item does not have a path and collapsed state is true */
<React.Fragment key={item.name}> <React.Fragment key={item.name}>
<Tooltip <Tooltip
placement="right" placement="right"
@@ -435,6 +454,7 @@ function Sidebar() {
</Menu> </Menu>
</React.Fragment> </React.Fragment>
) : ( ) : (
/* TODO Do we ever get here? If item does not have a path and collapsed state is false */
<React.Fragment key={item.name}> <React.Fragment key={item.name}>
<ListItemButton <ListItemButton
onClick={() => onClick={() =>