Added barebones theme toggle

This commit is contained in:
Daniel Cojocea committed 2024-08-28 22:14:55 -04:00
1 parent 9a62a42a09
commit aca350495a
21 files changed
+286 -105

No files matched your search

+7 -2
View File
@@ -8,7 +8,12 @@ import ClockSnooze from "../../../assets/icons/clock-snooze.svg?react";
const StatusBox = ({ title, value }) => {
const theme = useTheme();
let sharedStyles = { position: "absolute", right: 8, opacity: 0.5 };
let sharedStyles = {
position: "absolute",
right: 8,
opacity: 0.5,
"& svg path": { stroke: theme.palette.other.icon },
};
let color;
let icon;
@@ -48,7 +53,7 @@ const StatusBox = ({ title, value }) => {
overflow="hidden"
sx={{
"&:hover": {
backgroundColor: "#f9fafb",
backgroundColor: theme.palette.background.accent,
},
"&:after": {
position: "absolute",
@@ -77,6 +77,9 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
"&:focus": {
outline: "none",
},
"& svg path": {
stroke: theme.palette.other.icon,
},
}}
>
<Settings />
@@ -94,6 +97,7 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
borderColor: theme.palette.border.light,
borderRadius: theme.shape.borderRadius,
boxShadow: theme.shape.boxShadow,
backgroundColor: theme.palette.background.main,
"& ul": {
p: theme.spacing(2.5),
minWidth: "100px",
+1 -1
View File
@@ -145,7 +145,7 @@ const Monitors = ({ isAdmin }) => {
color={theme.palette.text.primary}
border={1}
borderColor={theme.palette.border.light}
backgroundColor={theme.palette.unresolved.bg}
backgroundColor={theme.palette.background.accent}
>
{monitorState.monitors.length}
</Box>
@@ -4,6 +4,7 @@ import BarChart from "../../../Components/Charts/BarChart";
import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded";
import { StatusLabel } from "../../../Components/Label";
import { Box } from "@mui/material";
import { useTheme } from "@emotion/react";
const data = {
cols: [
@@ -27,13 +28,17 @@ const data = {
};
export const buildData = (monitors, isAdmin, navigate) => {
const theme = useTheme();
data.rows = monitors.map((monitor, idx) => {
const params = {
url: monitor.url,
title: monitor.name,
percentage: 100,
percentageColor:
monitor.status === true ? "var(--success-color)" : "var(--error-color)",
monitor.status === true
? theme.palette.success.main
: theme.palette.error.text,
status: monitor.status === true ? "up" : "down",
};