Refactored mui themes into their own files for increased readability
This commit is contained in:
1 parent
111501156f
commit
8fa1acd193
9 files changed
+406
-153
No files matched your search
+3
-2
@@ -29,7 +29,8 @@ import CreateNewMaintenanceWindow from "./Pages/Maintenance/CreateMaintenanceWin
|
|||||||
import PageSpeedDetails from "./Pages/PageSpeed/Details";
|
import PageSpeedDetails from "./Pages/PageSpeed/Details";
|
||||||
import PageSpeedConfigure from "./Pages/PageSpeed/Configure";
|
import PageSpeedConfigure from "./Pages/PageSpeed/Configure";
|
||||||
import { ThemeProvider } from "@emotion/react";
|
import { ThemeProvider } from "@emotion/react";
|
||||||
import theme, { darkTheme } from "./Utils/Theme";
|
import lightTheme from "./Utils/Theme/lightTheme";
|
||||||
|
import darkTheme from "./Utils/Theme/darkTheme";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
@@ -42,7 +43,7 @@ function App() {
|
|||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={mode === "light" ? theme : darkTheme}>
|
<ThemeProvider theme={mode === "light" ? lightTheme : darkTheme}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route exact path="/" element={<HomeLayout />}>
|
<Route exact path="/" element={<HomeLayout />}>
|
||||||
<Route
|
<Route
|
||||||
|
|||||||
@@ -298,11 +298,8 @@ const BasicTable = ({ data, paginated, reversed, table }) => {
|
|||||||
PaperProps: {
|
PaperProps: {
|
||||||
className: "pagination-dropdown",
|
className: "pagination-dropdown",
|
||||||
sx: {
|
sx: {
|
||||||
border: 1,
|
mt: 0,
|
||||||
borderColor: theme.palette.border.light,
|
mb: theme.spacing(2),
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
boxShadow: theme.shape.boxShadow,
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
"& li": {
|
"& li": {
|
||||||
p: theme.spacing(2),
|
p: theme.spacing(2),
|
||||||
color: theme.palette.text.tertiary,
|
color: theme.palette.text.tertiary,
|
||||||
|
|||||||
@@ -78,16 +78,6 @@ const Select = ({
|
|||||||
displayEmpty
|
displayEmpty
|
||||||
inputProps={{ id: id }}
|
inputProps={{ id: id }}
|
||||||
MenuProps={{
|
MenuProps={{
|
||||||
PaperProps: {
|
|
||||||
sx: {
|
|
||||||
marginTop: theme.spacing(2),
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
boxShadow: theme.shape.boxShadow,
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
MenuListProps: {
|
MenuListProps: {
|
||||||
sx: {
|
sx: {
|
||||||
p: 0,
|
p: 0,
|
||||||
|
|||||||
@@ -102,19 +102,6 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
page={paginationController.page + 1} //0-indexed
|
page={paginationController.page + 1} //0-indexed
|
||||||
onChange={handlePageChange}
|
onChange={handlePageChange}
|
||||||
shape="rounded"
|
shape="rounded"
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
"& button": {
|
|
||||||
color: theme.palette.text.tertiary,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
},
|
|
||||||
"& li:first-of-type button, & li:last-of-type button": {
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
renderItem={(item) => (
|
renderItem={(item) => (
|
||||||
<PaginationItem
|
<PaginationItem
|
||||||
slots={{
|
slots={{
|
||||||
@@ -122,18 +109,6 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
next: ArrowForwardRoundedIcon,
|
next: ArrowForwardRoundedIcon,
|
||||||
}}
|
}}
|
||||||
{...item}
|
{...item}
|
||||||
sx={{
|
|
||||||
"&:focus": {
|
|
||||||
outline: "none",
|
|
||||||
},
|
|
||||||
"& .MuiTouchRipple-root": {
|
|
||||||
pointerEvents: "none",
|
|
||||||
display: "none",
|
|
||||||
},
|
|
||||||
"&.Mui-selected, &.Mui-selected:hover": {
|
|
||||||
backgroundColor: theme.palette.background.fill,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -164,30 +139,10 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<TableContainer
|
<TableContainer component={Paper}>
|
||||||
component={Paper}
|
|
||||||
sx={{
|
|
||||||
border: `solid 1px ${theme.palette.border.light}`,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
"& .MuiTableCell-root": {
|
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Table>
|
<Table>
|
||||||
<TableHead
|
<TableHead>
|
||||||
sx={{
|
<TableRow>
|
||||||
backgroundColor: theme.palette.background.accent,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TableRow
|
|
||||||
sx={{
|
|
||||||
"& > .MuiTableCell-root": {
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TableCell>Monitor Name</TableCell>
|
<TableCell>Monitor Name</TableCell>
|
||||||
<TableCell>Status</TableCell>
|
<TableCell>Status</TableCell>
|
||||||
<TableCell>Date & Time</TableCell>
|
<TableCell>Date & Time</TableCell>
|
||||||
|
|||||||
@@ -80,19 +80,6 @@ const PaginationTable = ({ monitorId, dateRange }) => {
|
|||||||
page={paginationController.page + 1} //0-indexed
|
page={paginationController.page + 1} //0-indexed
|
||||||
onChange={handlePageChange}
|
onChange={handlePageChange}
|
||||||
shape="rounded"
|
shape="rounded"
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
"& button": {
|
|
||||||
color: theme.palette.text.tertiary,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
},
|
|
||||||
"& li:first-of-type button, & li:last-of-type button": {
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
renderItem={(item) => (
|
renderItem={(item) => (
|
||||||
<PaginationItem
|
<PaginationItem
|
||||||
slots={{
|
slots={{
|
||||||
@@ -100,18 +87,6 @@ const PaginationTable = ({ monitorId, dateRange }) => {
|
|||||||
next: ArrowForwardRoundedIcon,
|
next: ArrowForwardRoundedIcon,
|
||||||
}}
|
}}
|
||||||
{...item}
|
{...item}
|
||||||
sx={{
|
|
||||||
"&:focus": {
|
|
||||||
outline: "none",
|
|
||||||
},
|
|
||||||
"& .MuiTouchRipple-root": {
|
|
||||||
pointerEvents: "none",
|
|
||||||
display: "none",
|
|
||||||
},
|
|
||||||
"&.Mui-selected, &.Mui-selected:hover": {
|
|
||||||
backgroundColor: theme.palette.background.fill,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -120,45 +95,13 @@ const PaginationTable = ({ monitorId, dateRange }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TableContainer
|
<TableContainer component={Paper}>
|
||||||
component={Paper}
|
|
||||||
sx={{
|
|
||||||
border: `solid 1px ${theme.palette.border.light}`,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Table>
|
<Table>
|
||||||
<TableHead
|
<TableHead>
|
||||||
sx={{
|
|
||||||
backgroundColor: theme.palette.background.accent,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell
|
<TableCell>Status</TableCell>
|
||||||
sx={{
|
<TableCell>Date & Time</TableCell>
|
||||||
color: theme.palette.text.secondary,
|
<TableCell>Message</TableCell>
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Status
|
|
||||||
</TableCell>
|
|
||||||
<TableCell
|
|
||||||
sx={{
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Date & Time
|
|
||||||
</TableCell>
|
|
||||||
<TableCell
|
|
||||||
sx={{
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Message
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
@@ -167,31 +110,17 @@ const PaginationTable = ({ monitorId, dateRange }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow key={check._id}>
|
<TableRow key={check._id}>
|
||||||
<TableCell
|
<TableCell>
|
||||||
sx={{
|
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<StatusLabel
|
<StatusLabel
|
||||||
status={status}
|
status={status}
|
||||||
text={status}
|
text={status}
|
||||||
customStyles={{ textTransform: "capitalize" }}
|
customStyles={{ textTransform: "capitalize" }}
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell>
|
||||||
sx={{
|
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{new Date(check.createdAt).toLocaleString()}
|
{new Date(check.createdAt).toLocaleString()}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell>{check.statusCode}</TableCell>
|
||||||
sx={{
|
|
||||||
borderBottomColor: theme.palette.border.light,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{check.statusCode}
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -93,11 +93,6 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
|
|||||||
slotProps={{
|
slotProps={{
|
||||||
paper: {
|
paper: {
|
||||||
sx: {
|
sx: {
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
boxShadow: theme.shape.boxShadow,
|
|
||||||
backgroundColor: theme.palette.background.main,
|
|
||||||
"& ul": {
|
"& ul": {
|
||||||
p: theme.spacing(2.5),
|
p: theme.spacing(2.5),
|
||||||
minWidth: "100px",
|
minWidth: "100px",
|
||||||
|
|||||||
+108
-4
@@ -55,7 +55,7 @@ const theme = createTheme({
|
|||||||
unresolved: { main: "#4e5ba6", light: "#e2eaf7", bg: "#f2f4f7" },
|
unresolved: { main: "#4e5ba6", light: "#e2eaf7", bg: "#f2f4f7" },
|
||||||
other: {
|
other: {
|
||||||
icon: "#667085",
|
icon: "#667085",
|
||||||
line: "#d6d9dd"
|
line: "#d6d9dd",
|
||||||
},
|
},
|
||||||
primary: {
|
primary: {
|
||||||
main: "#1570EF",
|
main: "#1570EF",
|
||||||
@@ -68,7 +68,59 @@ const theme = createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
components: {},
|
components: {
|
||||||
|
MuiButtonBase: {
|
||||||
|
defaultProps: {
|
||||||
|
disableRipple: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPaper: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
marginTop: 4,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: "#eaecf0",
|
||||||
|
borderRadius: 4,
|
||||||
|
boxShadow: shadow,
|
||||||
|
backgroundColor: "#FFFFFF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableCell: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderBottomColor: "#eaecf0",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableHead: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#f9fafb",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPagination: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#FFFFFF",
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: "#eaecf0",
|
||||||
|
"& button": {
|
||||||
|
color: "#475467",
|
||||||
|
borderRadius: 4,
|
||||||
|
},
|
||||||
|
"& li:first-of-type button, & li:last-of-type button": {
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: "#eaecf0",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
shape: {
|
shape: {
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
borderThick: 2,
|
borderThick: 2,
|
||||||
@@ -123,7 +175,7 @@ export const darkTheme = createTheme({
|
|||||||
unresolved: { main: "#4e5ba6", light: "#e2eaf7", bg: "#f2f4f7" },
|
unresolved: { main: "#4e5ba6", light: "#e2eaf7", bg: "#f2f4f7" },
|
||||||
other: {
|
other: {
|
||||||
icon: "#e6e6e6",
|
icon: "#e6e6e6",
|
||||||
line: "#27272a"
|
line: "#27272a",
|
||||||
},
|
},
|
||||||
primary: {
|
primary: {
|
||||||
main: "#1570ef",
|
main: "#1570ef",
|
||||||
@@ -136,7 +188,59 @@ export const darkTheme = createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
components: {},
|
components: {
|
||||||
|
MuiButtonBase: {
|
||||||
|
defaultProps: {
|
||||||
|
disableRipple: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPaper: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
marginTop: 4,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: "#27272a",
|
||||||
|
borderRadius: 4,
|
||||||
|
boxShadow: shadow,
|
||||||
|
backgroundColor: "#151518",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableCell: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderBottomColor: "#27272a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableHead: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#18181a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPagination: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#151518",
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: "#27272a",
|
||||||
|
"& button": {
|
||||||
|
color: "#a1a1aa",
|
||||||
|
borderRadius: 4,
|
||||||
|
},
|
||||||
|
"& li:first-of-type button, & li:last-of-type button": {
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: "#27272a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
shape: {
|
shape: {
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
borderThick: 2,
|
borderThick: 2,
|
||||||
|
|||||||
@@ -0,0 +1,141 @@
|
|||||||
|
import { createTheme } from "@mui/material";
|
||||||
|
|
||||||
|
const text = {
|
||||||
|
primary: "#fafafa",
|
||||||
|
secondary: "#e6e6e6",
|
||||||
|
tertiary: "#a1a1aa",
|
||||||
|
accent: "#e6e6e6",
|
||||||
|
};
|
||||||
|
const background = {
|
||||||
|
main: "#151518",
|
||||||
|
alt: "#09090b",
|
||||||
|
fill: "#2e2e2e",
|
||||||
|
accent: "#18181a",
|
||||||
|
};
|
||||||
|
const border = { light: "#27272a", dark: "#2c2c2c" };
|
||||||
|
|
||||||
|
const fontFamilyDefault =
|
||||||
|
'"Inter","system-ui", "Avenir", "Helvetica", "Arial", sans-serif';
|
||||||
|
const shadow =
|
||||||
|
"0px 4px 24px -4px rgba(16, 24, 40, 0.08), 0px 3px 3px -3px rgba(16, 24, 40, 0.03)";
|
||||||
|
|
||||||
|
const darkTheme = createTheme({
|
||||||
|
typography: { fontFamily: fontFamilyDefault, fontSize: 13 },
|
||||||
|
palette: {
|
||||||
|
common: { main: "#1570ef" },
|
||||||
|
text: text,
|
||||||
|
background: background,
|
||||||
|
border: border,
|
||||||
|
info: {
|
||||||
|
text: "#475467",
|
||||||
|
main: "#475467",
|
||||||
|
bg: "#ffffff",
|
||||||
|
light: "#ffffff",
|
||||||
|
border: "#D0D5DD",
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
text: "#079455",
|
||||||
|
main: "#45bb7a",
|
||||||
|
light: "#93d5aa",
|
||||||
|
bg: "#27272a",
|
||||||
|
},
|
||||||
|
error: {
|
||||||
|
text: "#f04438",
|
||||||
|
main: "#d32f2f",
|
||||||
|
light: "#f04438",
|
||||||
|
bg: "#27272a",
|
||||||
|
border: "#f04438",
|
||||||
|
},
|
||||||
|
warning: {
|
||||||
|
text: "#DC6803",
|
||||||
|
main: "#e88c30",
|
||||||
|
light: "#fffcf5",
|
||||||
|
bg: "#ffecbc",
|
||||||
|
border: "#fec84b",
|
||||||
|
},
|
||||||
|
unresolved: { main: "#4e5ba6", light: "#e2eaf7", bg: "#f2f4f7" },
|
||||||
|
other: {
|
||||||
|
icon: "#e6e6e6",
|
||||||
|
line: "#27272a",
|
||||||
|
},
|
||||||
|
primary: {
|
||||||
|
main: "#1570ef",
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
main: "#e6e6e6",
|
||||||
|
},
|
||||||
|
tertiary: {
|
||||||
|
main: "#e6e6e6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
spacing: 2,
|
||||||
|
components: {
|
||||||
|
MuiButtonBase: {
|
||||||
|
defaultProps: {
|
||||||
|
disableRipple: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPaper: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
marginTop: 4,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: border.light,
|
||||||
|
borderRadius: 4,
|
||||||
|
boxShadow: shadow,
|
||||||
|
backgroundColor: background.main,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableCell: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderBottomColor: border.light,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableHead: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: background.accent,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPagination: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: background.main,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: border.light,
|
||||||
|
"& button": {
|
||||||
|
color: text.tertiary,
|
||||||
|
borderRadius: 4,
|
||||||
|
},
|
||||||
|
"& li:first-of-type button, & li:last-of-type button": {
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: border.light,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPaginationItem: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
"&:not(.MuiPaginationItem-ellipsis):hover, &.Mui-selected": {
|
||||||
|
backgroundColor: background.fill,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
shape: {
|
||||||
|
borderRadius: 2,
|
||||||
|
borderThick: 2,
|
||||||
|
boxShadow: shadow,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default darkTheme;
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
import { createTheme } from "@mui/material";
|
||||||
|
|
||||||
|
const text = {
|
||||||
|
primary: "#1c2130",
|
||||||
|
secondary: "#344054",
|
||||||
|
tertiary: "#475467",
|
||||||
|
accent: "#838c99",
|
||||||
|
};
|
||||||
|
const background = {
|
||||||
|
main: "#FFFFFF",
|
||||||
|
alt: "#FCFCFD",
|
||||||
|
fill: "#F4F4F4",
|
||||||
|
accent: "#f9fafb",
|
||||||
|
};
|
||||||
|
const border = { light: "#eaecf0", dark: "#d0d5dd" };
|
||||||
|
|
||||||
|
const fontFamilyDefault =
|
||||||
|
'"Inter","system-ui", "Avenir", "Helvetica", "Arial", sans-serif';
|
||||||
|
const shadow =
|
||||||
|
"0px 4px 24px -4px rgba(16, 24, 40, 0.08), 0px 3px 3px -3px rgba(16, 24, 40, 0.03)";
|
||||||
|
|
||||||
|
const lightTheme = createTheme({
|
||||||
|
typography: { fontFamily: fontFamilyDefault, fontSize: 13 },
|
||||||
|
palette: {
|
||||||
|
common: { main: "#1570ef" },
|
||||||
|
text: text,
|
||||||
|
background: background,
|
||||||
|
border: border,
|
||||||
|
info: {
|
||||||
|
text: "#475467",
|
||||||
|
main: "#475467",
|
||||||
|
bg: "#ffffff",
|
||||||
|
light: "#ffffff",
|
||||||
|
border: "#D0D5DD",
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
text: "#079455",
|
||||||
|
main: "#17b26a",
|
||||||
|
light: "#d4f4e1",
|
||||||
|
bg: "#ecfdf3",
|
||||||
|
},
|
||||||
|
error: {
|
||||||
|
text: "#f04438",
|
||||||
|
main: "#d32f2f",
|
||||||
|
light: "#fbd1d1",
|
||||||
|
bg: "#f9eced",
|
||||||
|
border: "#f04438",
|
||||||
|
},
|
||||||
|
warning: {
|
||||||
|
text: "#DC6803",
|
||||||
|
main: "#fdb022",
|
||||||
|
light: "#fffcf5",
|
||||||
|
bg: "#ffecbc",
|
||||||
|
border: "#fec84b",
|
||||||
|
},
|
||||||
|
unresolved: { main: "#4e5ba6", light: "#e2eaf7", bg: "#f2f4f7" },
|
||||||
|
other: {
|
||||||
|
icon: "#667085",
|
||||||
|
line: "#d6d9dd",
|
||||||
|
},
|
||||||
|
primary: {
|
||||||
|
main: "#1570EF",
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
main: "#475467",
|
||||||
|
},
|
||||||
|
tertiary: {
|
||||||
|
main: "#475467",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
spacing: 2,
|
||||||
|
components: {
|
||||||
|
MuiButtonBase: {
|
||||||
|
defaultProps: {
|
||||||
|
disableRipple: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPaper: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
marginTop: 4,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: border.light,
|
||||||
|
borderRadius: 4,
|
||||||
|
boxShadow: shadow,
|
||||||
|
backgroundColor: background.main,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableCell: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderBottomColor: border.light,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTableHead: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: background.accent,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPagination: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: background.main,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: border.light,
|
||||||
|
"& button": {
|
||||||
|
color: text.tertiary,
|
||||||
|
borderRadius: 4,
|
||||||
|
},
|
||||||
|
"& li:first-of-type button, & li:last-of-type button": {
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: border.light,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiPaginationItem: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
"&:not(.MuiPaginationItem-ellipsis):hover, &.Mui-selected": {
|
||||||
|
backgroundColor: background.fill,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
shape: {
|
||||||
|
borderRadius: 2,
|
||||||
|
borderThick: 2,
|
||||||
|
boxShadow: shadow,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default lightTheme;
|
||||||
Reference in new issue
Block a user