extract colors to theme
This commit is contained in:
1 parent
2e9b87ba32
commit
3365a8f7da
4 files changed
+18
-11
No files matched your search
@@ -61,11 +61,7 @@ export const TabQueue = () => {
|
|||||||
highlight: (
|
highlight: (
|
||||||
<Box
|
<Box
|
||||||
component="span"
|
component="span"
|
||||||
bgcolor={
|
bgcolor={theme.palette.rowStatus.running}
|
||||||
theme.palette.mode === "dark"
|
|
||||||
? "rgba(19, 113, 91, 0.18)"
|
|
||||||
: "#ECF7F2"
|
|
||||||
}
|
|
||||||
color={theme.palette.text.primary}
|
color={theme.palette.text.primary}
|
||||||
px={SPACING.SM}
|
px={SPACING.SM}
|
||||||
py={SPACING.XXS}
|
py={SPACING.XXS}
|
||||||
|
|||||||
@@ -129,20 +129,16 @@ export const TableJobs = ({ jobs }: TableJobsProps) => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const isDark = theme.palette.mode === "dark";
|
|
||||||
const runningBg = isDark ? "rgba(19, 113, 91, 0.18)" : "#ECF7F2";
|
|
||||||
const pausedBg = isDark ? "rgba(255, 165, 0, 0.18)" : "#FFF4E5";
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
headers={headers}
|
headers={headers}
|
||||||
data={jobsWithId}
|
data={jobsWithId}
|
||||||
getRowSx={(row) => ({
|
getRowSx={(row) => ({
|
||||||
...(row.lockedAt && {
|
...(row.lockedAt && {
|
||||||
"& td": { backgroundColor: runningBg },
|
"& td": { backgroundColor: theme.palette.rowStatus.running },
|
||||||
}),
|
}),
|
||||||
...(row.monitorActive === false && {
|
...(row.monitorActive === false && {
|
||||||
"& td": { backgroundColor: pausedBg },
|
"& td": { backgroundColor: theme.palette.rowStatus.paused },
|
||||||
}),
|
}),
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { alpha } from "@mui/material/styles";
|
||||||
|
|
||||||
const typographyBase = 13;
|
const typographyBase = 13;
|
||||||
|
|
||||||
export const typographyLevels = {
|
export const typographyLevels = {
|
||||||
@@ -17,6 +19,9 @@ export const colors = {
|
|||||||
gray850: "#1c1c21",
|
gray850: "#1c1c21",
|
||||||
brandGreen: "#13715B",
|
brandGreen: "#13715B",
|
||||||
brandGreenLight: "#4DAF94",
|
brandGreenLight: "#4DAF94",
|
||||||
|
green200: "#ECF7F2",
|
||||||
|
yellow200: "#FFF4E5",
|
||||||
|
orange500: "#FFA500",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const lightPalette = {
|
export const lightPalette = {
|
||||||
@@ -29,6 +34,10 @@ export const lightPalette = {
|
|||||||
sidebar: {
|
sidebar: {
|
||||||
accent: colors.brandGreen,
|
accent: colors.brandGreen,
|
||||||
},
|
},
|
||||||
|
rowStatus: {
|
||||||
|
running: colors.green200,
|
||||||
|
paused: colors.yellow200,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const darkPalette = {
|
export const darkPalette = {
|
||||||
@@ -45,4 +54,8 @@ export const darkPalette = {
|
|||||||
sidebar: {
|
sidebar: {
|
||||||
accent: colors.brandGreenLight,
|
accent: colors.brandGreenLight,
|
||||||
},
|
},
|
||||||
|
rowStatus: {
|
||||||
|
running: alpha(colors.brandGreen, 0.18),
|
||||||
|
paused: alpha(colors.orange500, 0.18),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
@@ -15,9 +15,11 @@ declare module "@mui/material/styles" {
|
|||||||
}
|
}
|
||||||
interface Palette {
|
interface Palette {
|
||||||
sidebar: { accent: string };
|
sidebar: { accent: string };
|
||||||
|
rowStatus: { running: string; paused: string };
|
||||||
}
|
}
|
||||||
interface PaletteOptions {
|
interface PaletteOptions {
|
||||||
sidebar?: { accent: string };
|
sidebar?: { accent: string };
|
||||||
|
rowStatus?: { running: string; paused: string };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user