Refactored sx styling to theme file style overrides
This commit is contained in:
1 parent
bddca58a37
commit
4352b3690d
12 files changed
+90
-101
No files matched your search
@@ -57,6 +57,7 @@ const Avatar = ({ src, small, sx }) => {
|
||||
}
|
||||
sx={{
|
||||
fontSize: small ? "16px" : "22px",
|
||||
color: "white",
|
||||
fontWeight: 400,
|
||||
backgroundColor: stringToColor(`${user?.firstName} ${user?.lastName}`),
|
||||
display: "inline-flex",
|
||||
|
||||
@@ -120,17 +120,6 @@
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.pagination-dropdown ul {
|
||||
padding: 4px;
|
||||
min-width: 100px;
|
||||
}
|
||||
.pagination-dropdown li {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
body:has(.pagination-dropdown) p:has(+ .MuiTablePagination-root) {
|
||||
font-size: var(--env-var-font-size-small-plus);
|
||||
}
|
||||
|
||||
.monitors .MuiTable-root .MuiTableHead-root .MuiTableCell-root {
|
||||
text-transform: uppercase;
|
||||
opacity: 0.8;
|
||||
|
||||
@@ -272,7 +272,7 @@ const BasicTable = ({ data, paginated, reversed, table }) => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Typography px={theme.spacing(2)} sx={{ opacity: 0.7 }}>
|
||||
<Typography px={theme.spacing(2)} fontSize={12} sx={{ opacity: 0.7 }}>
|
||||
Showing {getRange()} of {data.rows.length} monitor(s)
|
||||
</Typography>
|
||||
<TablePagination
|
||||
@@ -300,19 +300,11 @@ const BasicTable = ({ data, paginated, reversed, table }) => {
|
||||
sx: {
|
||||
mt: 0,
|
||||
mb: theme.spacing(2),
|
||||
"& li": {
|
||||
p: theme.spacing(2),
|
||||
color: theme.palette.text.tertiary,
|
||||
},
|
||||
"& li.Mui-selected, & li.Mui-selected.Mui-focusVisible, & li.Mui-selected:hover":
|
||||
{
|
||||
backgroundColor: theme.palette.background.fill,
|
||||
},
|
||||
},
|
||||
},
|
||||
transformOrigin: { vertical: "bottom", horizontal: "left" },
|
||||
anchorOrigin: { vertical: "top", horizontal: "left" },
|
||||
sx: { mt: "-4px" },
|
||||
sx: { mt: theme.spacing(-2) },
|
||||
},
|
||||
inputProps: { id: "pagination-dropdown" },
|
||||
IconComponent: SelectorVertical,
|
||||
|
||||
@@ -33,7 +33,7 @@ const Breadcrumbs = ({ list }) => {
|
||||
lineHeight="18px"
|
||||
sx={{
|
||||
"& .MuiBreadcrumbs-li:not(:last-of-type):hover a": {
|
||||
backgroundColor: "#e3e3e3",
|
||||
backgroundColor: theme.palette.other.fill,
|
||||
opacity: 1,
|
||||
},
|
||||
}}
|
||||
|
||||
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
|
||||
import { useTheme } from "@emotion/react";
|
||||
import { Box, Stack, Typography } from "@mui/material";
|
||||
import Skeleton from "../../assets/Images/create-placeholder.svg?react";
|
||||
import background from "../../assets/Images/background_pattern_decorative.png";
|
||||
import Background from "../../assets/Images/background-grid.svg?react";
|
||||
import Button from "../Button";
|
||||
import Check from "../Check/Check";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
@@ -32,12 +32,18 @@ const Fallback = ({ title, checks, link = "/", isAdmin }) => {
|
||||
<Skeleton style={{ zIndex: 1 }} />
|
||||
<Box
|
||||
className="background-pattern-svg"
|
||||
sx={{ backgroundImage: `url(${background})` }}
|
||||
/>
|
||||
sx={{
|
||||
"& svg g g:last-of-type path": {
|
||||
stroke: theme.palette.border.light,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Background style={{ width: "100%" }} />
|
||||
</Box>
|
||||
<Stack gap={theme.spacing(4)} maxWidth={"275px"} zIndex={1}>
|
||||
<Typography
|
||||
component="h1"
|
||||
marginY={theme.spacing(6)}
|
||||
marginY={theme.spacing(4)}
|
||||
color={theme.palette.text.secondary}
|
||||
>
|
||||
A {title} is used to:
|
||||
|
||||
@@ -5,8 +5,3 @@
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.select-wrapper .MuiInputBase-root:has(> .MuiSelect-select),
|
||||
.MuiMenu-List .MuiMenuItem-root,
|
||||
.select-wrapper h3.MuiTypography-root {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
@@ -77,26 +77,9 @@ const Select = ({
|
||||
onChange={onChange}
|
||||
displayEmpty
|
||||
inputProps={{ id: id }}
|
||||
MenuProps={{
|
||||
MenuListProps: {
|
||||
sx: {
|
||||
p: 0,
|
||||
"& li": {
|
||||
color: theme.palette.text.secondary,
|
||||
fontSize: 13,
|
||||
px: theme.spacing(4),
|
||||
py: theme.spacing(2.5),
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
},
|
||||
"& li.Mui-selected, & li.Mui-selected.Mui-focusVisible, & li.Mui-selected:hover":
|
||||
{
|
||||
backgroundColor: theme.palette.background.fill,
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
IconComponent={KeyboardArrowDownIcon}
|
||||
sx={{
|
||||
fontSize: 13,
|
||||
minWidth: "125px",
|
||||
"& fieldset": {
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
|
||||
@@ -305,31 +305,12 @@ function Sidebar() {
|
||||
slotProps={{
|
||||
paper: {
|
||||
sx: {
|
||||
border: 1,
|
||||
borderColor: theme.palette.border.light,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
boxShadow: theme.shape.boxShadow,
|
||||
backgroundColor: theme.palette.background.main,
|
||||
mt: theme.spacing(-2),
|
||||
ml: theme.spacing(1),
|
||||
},
|
||||
},
|
||||
}}
|
||||
MenuListProps={{
|
||||
sx: {
|
||||
p: 3,
|
||||
minWidth: "100px",
|
||||
"& li": {
|
||||
color: theme.palette.text.secondary,
|
||||
fontSize: 13,
|
||||
px: theme.spacing(4),
|
||||
py: theme.spacing(2.5),
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
},
|
||||
"& li:hover": {
|
||||
backgroundColor: theme.palette.background.accent,
|
||||
},
|
||||
},
|
||||
}}
|
||||
MenuListProps={{ sx: { px: 1, py: 2 } }}
|
||||
sx={{
|
||||
ml: theme.spacing(8),
|
||||
"& .selected-path": {
|
||||
@@ -360,9 +341,13 @@ function Sidebar() {
|
||||
}}
|
||||
sx={{
|
||||
gap: theme.spacing(4),
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
pl: theme.spacing(4),
|
||||
mb: "1px",
|
||||
opacity: 0.9,
|
||||
"& svg": {
|
||||
"& path": {
|
||||
stroke: theme.palette.other.icon,
|
||||
strokeWidth: 1.1,
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
{child.icon}
|
||||
@@ -460,9 +445,7 @@ function Sidebar() {
|
||||
)
|
||||
)}
|
||||
</List>
|
||||
<Divider
|
||||
sx={{ my: theme.spacing(4), borderColor: theme.palette.border.light }}
|
||||
/>
|
||||
<Divider sx={{ my: theme.spacing(4) }} />
|
||||
{/* other */}
|
||||
<List
|
||||
component="nav"
|
||||
@@ -526,7 +509,7 @@ function Sidebar() {
|
||||
</Tooltip>
|
||||
))}
|
||||
</List>
|
||||
<Divider sx={{ mt: "auto", borderColor: theme.palette.border.light }} />
|
||||
<Divider sx={{ mt: "auto" }} />
|
||||
|
||||
<Stack
|
||||
direction="row"
|
||||
@@ -607,11 +590,6 @@ function Sidebar() {
|
||||
slotProps={{
|
||||
paper: {
|
||||
sx: {
|
||||
border: 1,
|
||||
borderColor: theme.palette.border.light,
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
boxShadow: theme.shape.boxShadow,
|
||||
backgroundColor: theme.palette.background.main,
|
||||
marginTop: theme.spacing(-4),
|
||||
marginLeft: collapsed ? theme.spacing(2) : 0,
|
||||
},
|
||||
@@ -619,18 +597,7 @@ function Sidebar() {
|
||||
}}
|
||||
MenuListProps={{
|
||||
sx: {
|
||||
p: 3,
|
||||
minWidth: "100px",
|
||||
"& li": {
|
||||
color: theme.palette.text.secondary,
|
||||
fontSize: 13,
|
||||
px: theme.spacing(4),
|
||||
py: theme.spacing(2.5),
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
},
|
||||
"& li:hover": {
|
||||
backgroundColor: theme.palette.background.accent,
|
||||
},
|
||||
p: 2,
|
||||
"& li:has(.MuiBox-root):hover": {
|
||||
backgroundColor: theme.palette.background.main,
|
||||
},
|
||||
@@ -652,11 +619,10 @@ function Sidebar() {
|
||||
</Box>
|
||||
</MenuItem>
|
||||
)}
|
||||
{collapsed && (
|
||||
<Divider sx={{ borderColor: theme.palette.border.light }} />
|
||||
)}
|
||||
{collapsed && <Divider />}
|
||||
<MenuItem onClick={() => dispatch(setMode("light"))}>Light</MenuItem>
|
||||
<MenuItem onClick={() => dispatch(setMode("dark"))}>Dark</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem
|
||||
onClick={logout}
|
||||
sx={{
|
||||
|
||||
Reference in new issue
Block a user