feat: all colors inside of sideBar

This commit is contained in:
Caio Cabral committed 2025-01-11 18:06:47 -05:00
1 parent 74c598e191
commit 5fcc87dab4
3 files changed
+34 -22

No files matched your search

+20 -10
View File
@@ -156,11 +156,14 @@ function Sidebar() {
} }
}, [location]); }, [location]);
const iconColor = theme.palette.primary.contrastText.tertiary;
/* TODO refactor this, there are a some ternaries and comments in the return */ /* TODO refactor this, there are a some ternaries and comments in the return */
return ( return (
<Stack <Stack
component="aside" component="aside"
className={collapsed ? "collapsed" : "expanded"} className={collapsed ? "collapsed" : "expanded"}
/* TODO general padding should be here */
py={theme.spacing(6)} py={theme.spacing(6)}
gap={theme.spacing(6)} gap={theme.spacing(6)}
sx={{ sx={{
@@ -181,7 +184,8 @@ function Sidebar() {
color: theme.palette.secondary.main, color: theme.palette.secondary.main,
}, },
"& .MuiList-root svg path": { "& .MuiList-root svg path": {
stroke: theme.palette.primary.contrastText.tertiary, /* Menu Icons */
stroke: iconColor,
}, },
"& p, & span, & .MuiListSubheader-root": { "& p, & span, & .MuiListSubheader-root": {
color: theme.palette.primary.contrastText.secondary, color: theme.palette.primary.contrastText.secondary,
@@ -264,18 +268,17 @@ function Sidebar() {
</Typography> </Typography>
</Stack> </Stack>
</Stack> </Stack>
{/* menu */}
<List <List
component="nav" component="nav"
aria-labelledby="nested-menu-subheader" aria-labelledby="nested-menu-subheader"
disablePadding disablePadding
subheader={ subheader={
/* TODO Increase Menu bottom spacing */
<ListSubheader <ListSubheader
component="div" component="div"
id="nested-menu-subheader" id="nested-menu-subheader"
sx={{ sx={{
pt: theme.spacing(4), py: theme.spacing(4),
/* TODO px should be centralized in container */
px: collapsed ? theme.spacing(2) : theme.spacing(4), px: collapsed ? theme.spacing(2) : theme.spacing(4),
backgroundColor: "transparent", backgroundColor: "transparent",
}} }}
@@ -286,7 +289,7 @@ function Sidebar() {
sx={{ sx={{
px: theme.spacing(6), px: theme.spacing(6),
height: "100%", height: "100%",
overflow: "hidden", /* overflow: "hidden", */
}} }}
> >
{menu.map((item) => {menu.map((item) =>
@@ -313,10 +316,12 @@ function Sidebar() {
className={location.pathname.includes(item.path) ? "selected-path" : ""} className={location.pathname.includes(item.path) ? "selected-path" : ""}
onClick={() => navigate(`/${item.path}`)} onClick={() => navigate(`/${item.path}`)}
sx={{ sx={{
/* TODO fixed height */ height: "37px", /*
TODO we do not need this height
minHeight: "37px", */
p: theme.spacing(5),
gap: theme.spacing(4), gap: theme.spacing(4),
borderRadius: theme.shape.borderRadius, borderRadius: theme.shape.borderRadius,
px: theme.spacing(4),
}} }}
> >
<ListItemIcon sx={{ minWidth: 0 }}>{item.icon}</ListItemIcon> <ListItemIcon sx={{ minWidth: 0 }}>{item.icon}</ListItemIcon>
@@ -380,6 +385,7 @@ function Sidebar() {
MenuListProps={{ sx: { px: 1, py: 2 } }} MenuListProps={{ sx: { px: 1, py: 2 } }}
sx={{ sx={{
ml: theme.spacing(8), ml: theme.spacing(8),
/* TODO what is this selection? */
"& .selected-path": { "& .selected-path": {
backgroundColor: theme.palette.tertiary.main, backgroundColor: theme.palette.tertiary.main,
}, },
@@ -412,6 +418,7 @@ function Sidebar() {
sx={{ sx={{
gap: theme.spacing(4), gap: theme.spacing(4),
opacity: 0.9, opacity: 0.9,
/* TODO this has no effect? */
"& svg": { "& svg": {
"& path": { "& path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: theme.palette.primary.contrastText.tertiary,
@@ -505,6 +512,7 @@ function Sidebar() {
backgroundColor: theme.palette.primary.lowContrast, backgroundColor: theme.palette.primary.lowContrast,
}, },
"&.selected-path::after": { "&.selected-path::after": {
/* TODO what is this selector doing? */
backgroundColor: theme.palette.primary.contrastText.tertiary, backgroundColor: theme.palette.primary.contrastText.tertiary,
transform: "scale(1.2)", transform: "scale(1.2)",
}, },
@@ -577,7 +585,7 @@ function Sidebar() {
marginLeft={"auto"} marginLeft={"auto"}
columnGap={theme.spacing(2)} columnGap={theme.spacing(2)}
> >
<ThemeSwitch /> <ThemeSwitch color={iconColor} />
<Tooltip <Tooltip
title="Controls" title="Controls"
disableInteractive disableInteractive
@@ -595,7 +603,8 @@ function Sidebar() {
height: "22px", height: "22px",
}, },
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, /* Vertical three dots */
stroke: iconColor,
}, },
}} }}
onClick={(event) => openPopup(event, "logout")} onClick={(event) => openPopup(event, "logout")}
@@ -653,6 +662,7 @@ function Sidebar() {
</Box> </Box>
</MenuItem> </MenuItem>
)} )}
{/* TODO Do we need two dividers? */}
{collapsed && <Divider />} {collapsed && <Divider />}
<Divider /> <Divider />
<MenuItem <MenuItem
@@ -662,7 +672,7 @@ function Sidebar() {
borderRadius: theme.shape.borderRadius, borderRadius: theme.shape.borderRadius,
pl: theme.spacing(4), pl: theme.spacing(4),
"& svg path": { "& svg path": {
stroke: theme.palette.primary.contrastText.tertiary, stroke: iconColor,
}, },
}} }}
> >
+5 -1
View File
@@ -15,7 +15,7 @@ import { useDispatch, useSelector } from "react-redux";
import { setMode } from "../../Features/UI/uiSlice"; import { setMode } from "../../Features/UI/uiSlice";
import "./index.css"; import "./index.css";
const ThemeSwitch = ({ width = 48, height = 48 }) => { const ThemeSwitch = ({ width = 48, height = 48, color }) => {
const mode = useSelector((state) => state.ui.mode); const mode = useSelector((state) => state.ui.mode);
const dispatch = useDispatch(); const dispatch = useDispatch();
@@ -37,6 +37,10 @@ const ThemeSwitch = ({ width = 48, height = 48 }) => {
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
justifyContent: "center", justifyContent: "center",
"& svg >:is(circle, g)": {
fill: color,
stroke: color,
},
}} }}
> >
<SunAndMoonIcon /> <SunAndMoonIcon />
+9 -11
View File
@@ -1,6 +1,6 @@
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import { Box, Stack /* , Typography */ } from "@mui/material"; import { Box, Stack, Typography } from "@mui/material";
import Arrow from "../../../assets/icons/top-right-arrow.svg?react"; import Arrow from "../../../assets/icons/top-right-arrow.svg?react";
import Background from "../../../assets/Images/background-grid.svg?react"; import Background from "../../../assets/Images/background-grid.svg?react";
import ClockSnooze from "../../../assets/icons/clock-snooze.svg?react"; import ClockSnooze from "../../../assets/icons/clock-snooze.svg?react";
@@ -84,17 +84,15 @@ const StatusBox = ({ title, value }) => {
> >
{value} {value}
{/*
TODO check with team if this is needed
<Typography <Typography
component="span" component="span"
fontSize={20} fontSize={20}
fontWeight={300} fontWeight={300}
color={theme.palette.primary.contrastText.secondary} color={theme.palette.primary.contrastText.secondary}
sx={{ opacity: 0.3 }} sx={{ opacity: 0.3 }}
> >
# #
</Typography> */} </Typography>
</Stack> </Stack>
</Box> </Box>
); );