color fixes

This commit is contained in:
Alex Holliday committed 2025-01-20 15:26:15 -08:00
1 parent bc9d8f0b3c
commit 8048dae81c
10 files changed
+89 -35

No files matched your search

@@ -39,7 +39,9 @@ const BarChart = ({ checks = [] }) => {
> >
{checks.map((check, index) => {checks.map((check, index) =>
check === "placeholder" ? ( check === "placeholder" ? (
/* TODO what is the purpose of this box? */ /* TODO what is the purpose of this box? */
// CAIO_REVIEW the purpose of this box is to make sure there are always at least 25 bars
// even if there are less than 25 checks
<Box <Box
key={`${check}-${index}`} key={`${check}-${index}`}
position="relative" position="relative"
@@ -143,7 +145,7 @@ const BarChart = ({ checks = [] }) => {
position="relative" position="relative"
width="9px" width="9px"
height="100%" height="100%"
backgroundColor={theme.palette.tertiary.main} backgroundColor={theme.palette.primary.lowContrast} // CAIO_REVIEW
sx={{ sx={{
borderRadius: theme.spacing(1.5), borderRadius: theme.spacing(1.5),
/* /*
@@ -139,7 +139,6 @@ const MonitorDetailsAreaChart = ({ checks, dateRange }) => {
const theme = useTheme(); const theme = useTheme();
const memoizedChecks = useMemo(() => checks, [checks[0]]); const memoizedChecks = useMemo(() => checks, [checks[0]]);
const [isHovered, setIsHovered] = useState(false); const [isHovered, setIsHovered] = useState(false);
return ( return (
<ResponsiveContainer <ResponsiveContainer
width="100%" width="100%"
@@ -176,12 +175,12 @@ const MonitorDetailsAreaChart = ({ checks, dateRange }) => {
> >
<stop <stop
offset="0%" offset="0%"
stopColor={theme.palette.primary.main} stopColor={theme.palette.accent.main}
stopOpacity={0.8} stopOpacity={0.8}
/> />
<stop <stop
offset="100%" offset="100%"
stopColor={theme.palette.primary.light} stopColor={theme.palette.accent.light}
stopOpacity={0} stopOpacity={0}
/> />
</linearGradient> </linearGradient>
@@ -202,10 +201,10 @@ const MonitorDetailsAreaChart = ({ checks, dateRange }) => {
<Area <Area
type="monotone" type="monotone"
dataKey="avgResponseTime" dataKey="avgResponseTime"
stroke={theme.palette.primary.main} stroke={theme.palette.accent.main} // CAIO_REVIEW
fill="url(#colorUv)" fill="url(#colorUv)"
strokeWidth={isHovered ? 2.5 : 1.5} strokeWidth={isHovered ? 2.5 : 1.5}
activeDot={{ stroke: theme.palette.primary.main, r: 5 }} activeDot={{ stroke: theme.palette.accent.main, r: 5 }} // CAIO_REVIEW
/> />
</AreaChart> </AreaChart>
</ResponsiveContainer> </ResponsiveContainer>
@@ -13,7 +13,12 @@ const getSx = (theme, type, maxWidth) => {
"&.Mui-focused .MuiOutlinedInput-notchedOutline": { "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
borderColor: theme.palette.accent.main, // Adjust focus border color borderColor: theme.palette.accent.main, // Adjust focus border color
}, },
"&.Mui-disabled .MuiOutlinedInput-notchedOutline": {
borderColor: theme.palette.primary.contrastText, // CAIO_REVIEW
opacity: 0.5,
},
}, },
"& .MuiFormHelperText-root": { "& .MuiFormHelperText-root": {
position: "absolute", position: "absolute",
bottom: `-${theme.spacing(24)}`, bottom: `-${theme.spacing(24)}`,
@@ -317,14 +317,14 @@ const ProfilePanel = () => {
sx={{ marginRight: "8px" }} sx={{ marginRight: "8px" }}
/> />
<Button <Button
variant="outlined" variant="contained" // CAIO_REIVEW
color="error" color="error"
onClick={handleDeletePicture} onClick={handleDeletePicture}
> >
Delete Delete
</Button> </Button>
<Button <Button
variant="outlined" variant="contained" // CAIO_REVIEW
color="accent" color="accent"
onClick={openPictureModal} onClick={openPictureModal}
> >
@@ -289,7 +289,7 @@ const TeamPanel = () => {
> >
<LoadingButton <LoadingButton
loading={isSendingInvite} loading={isSendingInvite}
variant="text" variant="contained" // CAIO_REVIEW
color="error" color="error"
onClick={closeInviteModal} onClick={closeInviteModal}
> >
@@ -136,7 +136,7 @@ const CreateMaintenance = () => {
const response = await networkService.getMonitorsByTeamId({ const response = await networkService.getMonitorsByTeamId({
authToken: authToken, authToken: authToken,
teamId: user.teamId, teamId: user.teamId,
limit: -1, limit: null,
types: ["http", "ping", "pagespeed"], types: ["http", "ping", "pagespeed"],
}); });
const monitors = response.data.data.monitors; const monitors = response.data.data.monitors;
@@ -360,7 +360,6 @@ const CreateMaintenance = () => {
<DatePicker <DatePicker
id="startDate" id="startDate"
disablePast disablePast
label="Date"
disableHighlightToday disableHighlightToday
value={form.startDate} value={form.startDate}
slots={{ openPickerIcon: CalendarIcon }} slots={{ openPickerIcon: CalendarIcon }}
@@ -400,6 +399,30 @@ const CreateMaintenance = () => {
"&:hover": { backgroundColor: "transparent" }, "&:hover": { backgroundColor: "transparent" },
}, },
}, },
// CAIO_REVIEW, entire popper
popper: {
sx: {
"& .MuiPickersDay-root": {
color: theme.palette.primary.contrastText,
"&.Mui-selected": {
backgroundColor: theme.palette.accent.main, // Selected day background
color: theme.palette.primary.contrastText, // Selected day text color
},
"&:hover": {
backgroundColor: theme.palette.accent.light, // Hover background
},
"&.Mui-disabled": {
color: theme.palette.primary.lowContrast, // Disabled day color
},
},
"& .MuiDayCalendar-weekDayLabel": {
color: theme.palette.primary.contrastText,
},
"& .MuiPickersCalendarHeader-label": {
color: theme.palette.primary.contrastText,
},
},
},
}} }}
sx={{}} sx={{}}
onChange={(newDate) => { onChange={(newDate) => {
@@ -53,26 +53,28 @@ const DownBarChart = memo(({ monitor, type, onBarHover }) => {
maxBarSize={7} maxBarSize={7}
background={{ fill: "transparent" }} background={{ fill: "transparent" }}
> >
{monitor.groupedDownChecks.map((entry, index) => ( {monitor.groupedDownChecks.map((entry, index) => {
<Cell return (
key={`cell-${entry.time}`} <Cell
fill={ key={`cell-${entry.time}`}
hoveredBarIndex === index fill={
? theme.palette.error.main hoveredBarIndex === index
: chartHovered ? theme.palette.error.main
? theme.palette.error.contrastText : chartHovered
: theme.palette.error.main ? theme.palette.error.light // CAIO_REVIEW
} : theme.palette.error.main
onMouseEnter={() => { }
setHoveredBarIndex(index); onMouseEnter={() => {
onBarHover(entry); setHoveredBarIndex(index);
}} onBarHover(entry);
onMouseLeave={() => { }}
setHoveredBarIndex(null); onMouseLeave={() => {
onBarHover({ time: null, totalChecks: 0 }); setHoveredBarIndex(null);
}} onBarHover({ time: null, totalChecks: 0 });
/> }}
))} />
);
})}
</Bar> </Bar>
</BarChart> </BarChart>
</ResponsiveContainer> </ResponsiveContainer>
@@ -69,7 +69,7 @@ const UpBarChart = memo(({ monitor, type, onBarHover }) => {
hoveredBarIndex === index hoveredBarIndex === index
? theme.palette[themeColor].main ? theme.palette[themeColor].main
: chartHovered : chartHovered
? theme.palette[themeColor].accent ? theme.palette[themeColor].light // CAIO_REVIEW
: theme.palette[themeColor].main : theme.palette[themeColor].main
} }
onMouseEnter={() => { onMouseEnter={() => {
@@ -19,8 +19,9 @@ import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
import ArrowForwardRoundedIcon from "@mui/icons-material/ArrowForwardRounded"; import ArrowForwardRoundedIcon from "@mui/icons-material/ArrowForwardRounded";
import { logger } from "../../../../Utils/Logger"; import { logger } from "../../../../Utils/Logger";
import { formatDateWithTz } from "../../../../Utils/timeUtils"; import { formatDateWithTz } from "../../../../Utils/timeUtils";
import { useTheme } from "@emotion/react";
const PaginationTable = ({ monitorId, dateRange }) => { const PaginationTable = ({ monitorId, dateRange }) => {
const theme = useTheme();
const { authToken } = useSelector((state) => state.auth); const { authToken } = useSelector((state) => state.auth);
const [checks, setChecks] = useState([]); const [checks, setChecks] = useState([]);
const [checksCount, setChecksCount] = useState(0); const [checksCount, setChecksCount] = useState(0);
@@ -96,7 +97,23 @@ const PaginationTable = ({ monitorId, dateRange }) => {
return ( return (
<> <>
<TableContainer component={Paper}> <TableContainer component={Paper}>
<Table> <Table
sx={{
"&.MuiTable-root :is(.MuiTableHead-root, .MuiTableBody-root) :is(th, td)": {
paddingLeft: theme.spacing(8),
},
"& :is(th)": {
backgroundColor: theme.palette.secondary.main,
color: theme.palette.secondary.contrastText,
fontWeight: 600,
fontSize: "12px",
},
"& :is(td)": {
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastTextSecondary,
},
}}
>
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableCell>Status</TableCell> <TableCell>Status</TableCell>
+6
View File
@@ -1,3 +1,5 @@
import { lighten } from "@mui/material/styles"; // CAIO_REVIEW
const typographyBase = 14; const typographyBase = 14;
/* TODO /* TODO
@@ -122,6 +124,10 @@ const newSemanticColors = {
light: newColors.blueBlueWave, light: newColors.blueBlueWave,
dark: newColors.blueBlueWave, dark: newColors.blueBlueWave,
}, },
light: {
light: lighten(newColors.blueBlueWave, 0.2), //CAIO_REVIEW
dark: lighten(newColors.blueBlueWave, 0.2), //CAIO_REVIEW
},
contrastText: { contrastText: {
light: newColors.offWhite, light: newColors.offWhite,
dark: newColors.offWhite, dark: newColors.offWhite,