feat: reoganizing color scheme
This commit is contained in:
1 parent
097b719159
commit
067400437f
19 files changed
+282
-147
No files matched your search
@@ -31,6 +31,7 @@ const icons = {
|
|||||||
|
|
||||||
const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
|
const Alert = ({ variant, title, body, isToast, hasIcon = true, onClick }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
/* TODO check if this still works. text bg and border not necessarilly exist. Text becomes contrastText. border becomes contrastText. bg becomes dark */
|
||||||
const { text, bg, border } = theme.palette[variant];
|
const { text, bg, border } = theme.palette[variant];
|
||||||
const icon = icons[variant];
|
const icon = icons[variant];
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { useEffect, useState } from "react";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
|
/* TODO add prop validation and jsdocs */
|
||||||
const BarChart = ({ checks = [] }) => {
|
const BarChart = ({ checks = [] }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [animate, setAnimate] = useState(false);
|
const [animate, setAnimate] = useState(false);
|
||||||
@@ -65,7 +66,9 @@ const BarChart = ({ checks = [] }) => {
|
|||||||
width={theme.spacing(4)}
|
width={theme.spacing(4)}
|
||||||
height={theme.spacing(4)}
|
height={theme.spacing(4)}
|
||||||
backgroundColor={
|
backgroundColor={
|
||||||
check.status ? theme.palette.success.main : theme.palette.error.text
|
check.status
|
||||||
|
? theme.palette.success.main
|
||||||
|
: theme.palette.error.contrastText
|
||||||
}
|
}
|
||||||
sx={{ borderRadius: "50%" }}
|
sx={{ borderRadius: "50%" }}
|
||||||
/>
|
/>
|
||||||
@@ -138,7 +141,7 @@ const BarChart = ({ checks = [] }) => {
|
|||||||
width="9px"
|
width="9px"
|
||||||
height="100%"
|
height="100%"
|
||||||
backgroundColor={
|
backgroundColor={
|
||||||
check.status ? theme.palette.success.bg : theme.palette.error.bg
|
check.status ? theme.palette.success.dark : theme.palette.error.dark
|
||||||
}
|
}
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius: theme.spacing(1.5),
|
borderRadius: theme.spacing(1.5),
|
||||||
@@ -153,7 +156,9 @@ const BarChart = ({ checks = [] }) => {
|
|||||||
width="100%"
|
width="100%"
|
||||||
height={`${animate ? check.responseTime : 0}%`}
|
height={`${animate ? check.responseTime : 0}%`}
|
||||||
backgroundColor={
|
backgroundColor={
|
||||||
check.status ? theme.palette.success.main : theme.palette.error.text
|
check.status
|
||||||
|
? theme.palette.success.main
|
||||||
|
: theme.palette.error.contrastText
|
||||||
}
|
}
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius: theme.spacing(1.5),
|
borderRadius: theme.spacing(1.5),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const Check = ({ text, noHighlightText, variant = "info", outlined = false }) =>
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const colors = {
|
const colors = {
|
||||||
success: theme.palette.success.main,
|
success: theme.palette.success.main,
|
||||||
error: theme.palette.error.text,
|
error: theme.palette.error.contrastText,
|
||||||
info: theme.palette.info.border,
|
info: theme.palette.info.border,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const Field = forwardRef(
|
|||||||
borderColor: theme.palette.border.dark,
|
borderColor: theme.palette.border.dark,
|
||||||
},
|
},
|
||||||
"&:has(.input-error) .MuiOutlinedInput-root fieldset": {
|
"&:has(.input-error) .MuiOutlinedInput-root fieldset": {
|
||||||
borderColor: theme.palette.error.text,
|
borderColor: theme.palette.error.contrastText,
|
||||||
},
|
},
|
||||||
display: hidden ? "none" : "",
|
display: hidden ? "none" : "",
|
||||||
}}
|
}}
|
||||||
@@ -83,7 +83,7 @@ const Field = forwardRef(
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
ml={theme.spacing(1)}
|
ml={theme.spacing(1)}
|
||||||
color={theme.palette.error.text}
|
color={theme.palette.error.contrastText}
|
||||||
>
|
>
|
||||||
*
|
*
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -189,7 +189,7 @@ const Field = forwardRef(
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
className="input-error"
|
className="input-error"
|
||||||
color={theme.palette.error.text}
|
color={theme.palette.error.contrastText}
|
||||||
mt={theme.spacing(2)}
|
mt={theme.spacing(2)}
|
||||||
sx={{
|
sx={{
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ const Search = ({
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
className="input-error"
|
className="input-error"
|
||||||
color={theme.palette.error.text}
|
color={theme.palette.error.contrastText}
|
||||||
mt={theme.spacing(2)}
|
mt={theme.spacing(2)}
|
||||||
sx={{
|
sx={{
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
|
|||||||
@@ -127,22 +127,22 @@ const StatusLabel = ({ status, text, customStyles }) => {
|
|||||||
const colors = {
|
const colors = {
|
||||||
up: {
|
up: {
|
||||||
dotColor: theme.palette.success.main,
|
dotColor: theme.palette.success.main,
|
||||||
bgColor: theme.palette.success.bg,
|
bgColor: theme.palette.success.dark,
|
||||||
borderColor: theme.palette.success.light,
|
borderColor: theme.palette.success.light,
|
||||||
},
|
},
|
||||||
down: {
|
down: {
|
||||||
dotColor: theme.palette.error.text,
|
dotColor: theme.palette.error.contrastText,
|
||||||
bgColor: theme.palette.error.bg,
|
bgColor: theme.palette.error.dark,
|
||||||
borderColor: theme.palette.error.light,
|
borderColor: theme.palette.error.light,
|
||||||
},
|
},
|
||||||
paused: {
|
paused: {
|
||||||
dotColor: theme.palette.warning.main,
|
dotColor: theme.palette.warning.main,
|
||||||
bgColor: theme.palette.warning.bg,
|
bgColor: theme.palette.warning.dark,
|
||||||
borderColor: theme.palette.warning.light,
|
borderColor: theme.palette.warning.light,
|
||||||
},
|
},
|
||||||
pending: {
|
pending: {
|
||||||
dotColor: theme.palette.warning.main,
|
dotColor: theme.palette.warning.main,
|
||||||
bgColor: theme.palette.warning.bg,
|
bgColor: theme.palette.warning.dark,
|
||||||
borderColor: theme.palette.warning.light,
|
borderColor: theme.palette.warning.light,
|
||||||
},
|
},
|
||||||
"cannot resolve": {
|
"cannot resolve": {
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ const ProgressUpload = ({ icon, label, size, progress = 0, onClick, error }) =>
|
|||||||
backgroundColor: theme.palette.background.fill,
|
backgroundColor: theme.palette.background.fill,
|
||||||
"&:has(.input-error)": {
|
"&:has(.input-error)": {
|
||||||
borderColor: theme.palette.error.main,
|
borderColor: theme.palette.error.main,
|
||||||
backgroundColor: theme.palette.error.bg,
|
backgroundColor: theme.palette.error.dark,
|
||||||
py: theme.spacing(4),
|
py: theme.spacing(4),
|
||||||
px: theme.spacing(8),
|
px: theme.spacing(8),
|
||||||
"& > .MuiStack-root > svg": {
|
"& > .MuiStack-root > svg": {
|
||||||
fill: theme.palette.error.text,
|
fill: theme.palette.error.contrastText,
|
||||||
width: "20px",
|
width: "20px",
|
||||||
height: "20px",
|
height: "20px",
|
||||||
},
|
},
|
||||||
@@ -85,7 +85,7 @@ const ProgressUpload = ({ icon, label, size, progress = 0, onClick, error }) =>
|
|||||||
<Typography
|
<Typography
|
||||||
component="p"
|
component="p"
|
||||||
className="input-error"
|
className="input-error"
|
||||||
color={theme.palette.error.text}
|
color={theme.palette.error.contrastText}
|
||||||
>
|
>
|
||||||
{error}
|
{error}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ const ActionsMenu = ({ /* isAdmin, */ maintenanceWindow, updateCallback }) => {
|
|||||||
"& ul": { p: theme.spacing(2.5) },
|
"& ul": { p: theme.spacing(2.5) },
|
||||||
"& li": { m: 0 },
|
"& li": { m: 0 },
|
||||||
"& li:last-of-type": {
|
"& li:last-of-type": {
|
||||||
color: theme.palette.error.text,
|
color: theme.palette.error.contrastText,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
||||||
import LoadingButton from '@mui/lab/LoadingButton';
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import { checkEndpointResolution } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice"
|
import { checkEndpointResolution } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
@@ -151,9 +151,11 @@ const CreateMonitor = () => {
|
|||||||
if (monitor.type === "http") {
|
if (monitor.type === "http") {
|
||||||
const checkEndpointAction = await dispatch(
|
const checkEndpointAction = await dispatch(
|
||||||
checkEndpointResolution({ authToken, monitorURL: form.url })
|
checkEndpointResolution({ authToken, monitorURL: form.url })
|
||||||
)
|
);
|
||||||
if (checkEndpointAction.meta.requestStatus === "rejected") {
|
if (checkEndpointAction.meta.requestStatus === "rejected") {
|
||||||
createToast({ body: "The endpoint you entered doesn't resolve. Check the URL again." });
|
createToast({
|
||||||
|
body: "The endpoint you entered doesn't resolve. Check the URL again.",
|
||||||
|
});
|
||||||
setErrors({ url: "The entered URL is not reachable." });
|
setErrors({ url: "The entered URL is not reachable." });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -304,7 +306,7 @@ const CreateMonitor = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="p"
|
component="p"
|
||||||
className="input-error"
|
className="input-error"
|
||||||
color={theme.palette.error.text}
|
color={theme.palette.error.contrastText}
|
||||||
>
|
>
|
||||||
{errors["type"]}
|
{errors["type"]}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const UpBarChart = memo(({ data, type, onBarHover }) => {
|
|||||||
? { main: theme.palette.success.main, light: theme.palette.success.light }
|
? { main: theme.palette.success.main, light: theme.palette.success.light }
|
||||||
: uptime > 50
|
: uptime > 50
|
||||||
? { main: theme.palette.warning.main, light: theme.palette.warning.light }
|
? { main: theme.palette.warning.main, light: theme.palette.warning.light }
|
||||||
: { main: theme.palette.error.text, light: theme.palette.error.light };
|
: { main: theme.palette.error.contrastText, light: theme.palette.error.light };
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO - REMOVE THIS LATER
|
// TODO - REMOVE THIS LATER
|
||||||
@@ -201,10 +201,10 @@ const DownBarChart = memo(({ data, type, onBarHover }) => {
|
|||||||
key={`cell-${entry.time}`}
|
key={`cell-${entry.time}`}
|
||||||
fill={
|
fill={
|
||||||
hoveredBarIndex === index
|
hoveredBarIndex === index
|
||||||
? theme.palette.error.text
|
? theme.palette.error.contrastText
|
||||||
: chartHovered
|
: chartHovered
|
||||||
? theme.palette.error.light
|
? theme.palette.error.light
|
||||||
: theme.palette.error.text
|
: theme.palette.error.contrastText
|
||||||
}
|
}
|
||||||
onMouseEnter={() => {
|
onMouseEnter={() => {
|
||||||
setHoveredBarIndex(index);
|
setHoveredBarIndex(index);
|
||||||
@@ -246,24 +246,24 @@ const ResponseGaugeChart = ({ data }) => {
|
|||||||
? {
|
? {
|
||||||
category: "Excellent",
|
category: "Excellent",
|
||||||
main: theme.palette.success.main,
|
main: theme.palette.success.main,
|
||||||
bg: theme.palette.success.bg,
|
bg: theme.palette.success.dark,
|
||||||
}
|
}
|
||||||
: responseTime <= 500
|
: responseTime <= 500
|
||||||
? {
|
? {
|
||||||
category: "Fair",
|
category: "Fair",
|
||||||
main: theme.palette.success.main,
|
main: theme.palette.success.main,
|
||||||
bg: theme.palette.success.bg,
|
bg: theme.palette.success.dark,
|
||||||
}
|
}
|
||||||
: responseTime <= 600
|
: responseTime <= 600
|
||||||
? {
|
? {
|
||||||
category: "Acceptable",
|
category: "Acceptable",
|
||||||
main: theme.palette.warning.main,
|
main: theme.palette.warning.main,
|
||||||
bg: theme.palette.warning.bg,
|
bg: theme.palette.warning.dark,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
category: "Poor",
|
category: "Poor",
|
||||||
main: theme.palette.error.text,
|
main: theme.palette.error.contrastText,
|
||||||
bg: theme.palette.error.bg,
|
bg: theme.palette.error.dark,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const StatusBox = ({ title, value }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
} else if (title === "down") {
|
} else if (title === "down") {
|
||||||
color = theme.palette.error.text;
|
color = theme.palette.error.contrastText;
|
||||||
icon = (
|
icon = (
|
||||||
<Box sx={{ ...sharedStyles, transform: "rotate(180deg)", top: 5 }}>
|
<Box sx={{ ...sharedStyles, transform: "rotate(180deg)", top: 5 }}>
|
||||||
<Arrow />
|
<Arrow />
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ const ActionsMenu = ({ monitor, isAdmin, updateCallback }) => {
|
|||||||
"& ul": { p: theme.spacing(2.5) },
|
"& ul": { p: theme.spacing(2.5) },
|
||||||
"& li": { m: 0 },
|
"& li": { m: 0 },
|
||||||
"& li:last-of-type": {
|
"& li:last-of-type": {
|
||||||
color: theme.palette.error.text,
|
color: theme.palette.error.contrastText,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,20 +28,20 @@ const useUtils = () => {
|
|||||||
};
|
};
|
||||||
const statusStyles = {
|
const statusStyles = {
|
||||||
up: {
|
up: {
|
||||||
backgroundColor: theme.palette.success.bg,
|
backgroundColor: theme.palette.success.dark,
|
||||||
background: `linear-gradient(340deg, ${theme.palette.success.light} -60%, ${theme.palette.success.bg} 35%)`,
|
background: `linear-gradient(340deg, ${theme.palette.success.light} -60%, ${theme.palette.success.dark} 35%)`,
|
||||||
borderColor: theme.palette.success.light,
|
borderColor: theme.palette.success.light,
|
||||||
"& h2": { color: theme.palette.success.main },
|
"& h2": { color: theme.palette.success.main },
|
||||||
},
|
},
|
||||||
down: {
|
down: {
|
||||||
backgroundColor: theme.palette.error.bg,
|
backgroundColor: theme.palette.error.dark,
|
||||||
background: `linear-gradient(340deg, ${theme.palette.error.light} -60%, ${theme.palette.error.bg} 35%)`,
|
background: `linear-gradient(340deg, ${theme.palette.error.light} -60%, ${theme.palette.error.dark} 35%)`,
|
||||||
borderColor: theme.palette.error.light,
|
borderColor: theme.palette.error.light,
|
||||||
"& h2": { color: theme.palette.error.main },
|
"& h2": { color: theme.palette.error.main },
|
||||||
},
|
},
|
||||||
paused: {
|
paused: {
|
||||||
backgroundColor: theme.palette.warning.bg,
|
backgroundColor: theme.palette.warning.dark,
|
||||||
background: `linear-gradient(340deg, ${theme.palette.warning.light} -60%, ${theme.palette.warning.bg} 35%)`,
|
background: `linear-gradient(340deg, ${theme.palette.warning.light} -60%, ${theme.palette.warning.dark} 35%)`,
|
||||||
borderColor: theme.palette.warning.light,
|
borderColor: theme.palette.warning.light,
|
||||||
"& h2": { color: theme.palette.warning.main },
|
"& h2": { color: theme.palette.warning.main },
|
||||||
},
|
},
|
||||||
@@ -54,22 +54,22 @@ const useUtils = () => {
|
|||||||
};
|
};
|
||||||
const pagespeedStyles = {
|
const pagespeedStyles = {
|
||||||
up: {
|
up: {
|
||||||
bg: theme.palette.success.bg,
|
bg: theme.palette.success.dark,
|
||||||
light: theme.palette.success.light,
|
light: theme.palette.success.light,
|
||||||
stroke: theme.palette.success.main,
|
stroke: theme.palette.success.main,
|
||||||
},
|
},
|
||||||
down: {
|
down: {
|
||||||
bg: theme.palette.error.bg,
|
bg: theme.palette.error.dark,
|
||||||
light: theme.palette.error.light,
|
light: theme.palette.error.light,
|
||||||
stroke: theme.palette.error.main,
|
stroke: theme.palette.error.main,
|
||||||
},
|
},
|
||||||
paused: {
|
paused: {
|
||||||
bg: theme.palette.warning.bg,
|
bg: theme.palette.warning.dark,
|
||||||
light: theme.palette.warning.light,
|
light: theme.palette.warning.light,
|
||||||
stroke: theme.palette.warning.main,
|
stroke: theme.palette.warning.main,
|
||||||
},
|
},
|
||||||
pending: {
|
pending: {
|
||||||
bg: theme.palette.warning.bg,
|
bg: theme.palette.warning.dark,
|
||||||
light: theme.palette.warning.light,
|
light: theme.palette.warning.light,
|
||||||
stroke: theme.palette.warning.main,
|
stroke: theme.palette.warning.main,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
||||||
import LoadingButton from '@mui/lab/LoadingButton';
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { createPageSpeed, checkEndpointResolution } from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice";
|
import {
|
||||||
|
createPageSpeed,
|
||||||
|
checkEndpointResolution,
|
||||||
|
} from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
import { ConfigBox } from "../../Monitors/styled";
|
import { ConfigBox } from "../../Monitors/styled";
|
||||||
@@ -115,9 +118,11 @@ const CreatePageSpeed = () => {
|
|||||||
} else {
|
} else {
|
||||||
const checkEndpointAction = await dispatch(
|
const checkEndpointAction = await dispatch(
|
||||||
checkEndpointResolution({ authToken, monitorURL: form.url })
|
checkEndpointResolution({ authToken, monitorURL: form.url })
|
||||||
)
|
);
|
||||||
if (checkEndpointAction.meta.requestStatus === "rejected") {
|
if (checkEndpointAction.meta.requestStatus === "rejected") {
|
||||||
createToast({ body: "The endpoint you entered doesn't resolve. Check the URL again." });
|
createToast({
|
||||||
|
body: "The endpoint you entered doesn't resolve. Check the URL again.",
|
||||||
|
});
|
||||||
setErrors({ url: "The entered URL is not reachable." });
|
setErrors({ url: "The entered URL is not reachable." });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -129,9 +134,7 @@ const CreatePageSpeed = () => {
|
|||||||
userId: user._id,
|
userId: user._id,
|
||||||
notifications: monitor.notifications,
|
notifications: monitor.notifications,
|
||||||
};
|
};
|
||||||
const action = await dispatch(
|
const action = await dispatch(createPageSpeed({ authToken, monitor: form }));
|
||||||
createPageSpeed({ authToken, monitor: form })
|
|
||||||
);
|
|
||||||
if (action.meta.requestStatus === "fulfilled") {
|
if (action.meta.requestStatus === "fulfilled") {
|
||||||
createToast({ body: "Monitor created successfully!" });
|
createToast({ body: "Monitor created successfully!" });
|
||||||
navigate("/pagespeed");
|
navigate("/pagespeed");
|
||||||
@@ -175,8 +178,14 @@ const CreatePageSpeed = () => {
|
|||||||
gap={theme.spacing(12)}
|
gap={theme.spacing(12)}
|
||||||
mt={theme.spacing(6)}
|
mt={theme.spacing(6)}
|
||||||
>
|
>
|
||||||
<Typography component="h1" variant="h1">
|
<Typography
|
||||||
<Typography component="span" fontSize="inherit">
|
component="h1"
|
||||||
|
variant="h1"
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
fontSize="inherit"
|
||||||
|
>
|
||||||
Create your{" "}
|
Create your{" "}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
@@ -192,8 +201,7 @@ const CreatePageSpeed = () => {
|
|||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">General settings</Typography>
|
<Typography component="h2">General settings</Typography>
|
||||||
<Typography component="p">
|
<Typography component="p">
|
||||||
Here you can select the URL of the host, together with the type of
|
Here you can select the URL of the host, together with the type of monitor.
|
||||||
monitor.
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.spacing(15)}>
|
<Stack gap={theme.spacing(15)}>
|
||||||
@@ -259,7 +267,7 @@ const CreatePageSpeed = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="p"
|
component="p"
|
||||||
className="input-error"
|
className="input-error"
|
||||||
color={theme.palette.error.text}
|
color={theme.palette.error.contrastText}
|
||||||
>
|
>
|
||||||
{errors["type"]}
|
{errors["type"]}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -337,7 +345,10 @@ const CreatePageSpeed = () => {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
justifyContent="flex-end"
|
||||||
|
>
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|||||||
@@ -127,22 +127,22 @@ const PieChart = ({ audits }) => {
|
|||||||
return {
|
return {
|
||||||
stroke: theme.palette.success.main,
|
stroke: theme.palette.success.main,
|
||||||
strokeBg: theme.palette.success.light,
|
strokeBg: theme.palette.success.light,
|
||||||
text: theme.palette.success.text,
|
text: theme.palette.success.contrastText,
|
||||||
bg: theme.palette.success.bg,
|
bg: theme.palette.success.dark,
|
||||||
};
|
};
|
||||||
else if (value >= 50 && value < 90)
|
else if (value >= 50 && value < 90)
|
||||||
return {
|
return {
|
||||||
stroke: theme.palette.warning.main,
|
stroke: theme.palette.warning.main,
|
||||||
strokeBg: theme.palette.warning.light,
|
strokeBg: theme.palette.warning.light,
|
||||||
text: theme.palette.warning.text,
|
text: theme.palette.warning.contrastText,
|
||||||
bg: theme.palette.warning.bg,
|
bg: theme.palette.warning.dark,
|
||||||
};
|
};
|
||||||
else if (value >= 0 && value < 50)
|
else if (value >= 0 && value < 50)
|
||||||
return {
|
return {
|
||||||
stroke: theme.palette.error.text,
|
stroke: theme.palette.error.contrastText,
|
||||||
strokeBg: theme.palette.error.light,
|
strokeBg: theme.palette.error.light,
|
||||||
text: theme.palette.error.text,
|
text: theme.palette.error.contrastText,
|
||||||
bg: theme.palette.error.bg,
|
bg: theme.palette.error.dark,
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
stroke: theme.palette.unresolved.main,
|
stroke: theme.palette.unresolved.main,
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ const PageSpeedDetails = ({ isAdmin }) => {
|
|||||||
: score >= 50
|
: score >= 50
|
||||||
? theme.palette.warning.main
|
? theme.palette.warning.main
|
||||||
: score >= 0
|
: score >= 0
|
||||||
? theme.palette.error.text
|
? theme.palette.error.contrastText
|
||||||
: theme.palette.unresolved.main;
|
: theme.palette.unresolved.main;
|
||||||
|
|
||||||
// Find the position where the number ends and the unit begins
|
// Find the position where the number ends and the unit begins
|
||||||
|
|||||||
@@ -27,34 +27,127 @@ const paletteColors = {
|
|||||||
gray70: "#FDFDFD",
|
gray70: "#FDFDFD",
|
||||||
gray80: "#FDFCFD",
|
gray80: "#FDFCFD",
|
||||||
gray90: "#FCFCFD",
|
gray90: "#FCFCFD",
|
||||||
|
gray100: "#F4F4F4",
|
||||||
|
gray200: "#E3E3E3",
|
||||||
|
gray800: "#2D2D33",
|
||||||
|
gray830: "#262115",
|
||||||
gray850: "#131315",
|
gray850: "#131315",
|
||||||
gray860: "#111113",
|
gray860: "#111113",
|
||||||
gray870: "#0F0F11",
|
gray870: "#0F0F11",
|
||||||
gray880: "#0C0C0E",
|
gray880: "#0C0C0E",
|
||||||
gray890: "#09090B",
|
gray890: "#09090B",
|
||||||
black: "#000000",
|
black: "#000000",
|
||||||
|
blueBlueWave: "#1570EF",
|
||||||
|
blue700: "#475467",
|
||||||
|
green20: "#ECFDF3",
|
||||||
|
green50: "#D4F4E1",
|
||||||
|
green150: "#45BB7A",
|
||||||
|
green200: "#17B26A",
|
||||||
|
green400: "#079455",
|
||||||
|
green800: "#1C4428",
|
||||||
|
green900: "#12261E",
|
||||||
|
red50: "#F9ECED",
|
||||||
|
red100: "#FBD1D1",
|
||||||
|
red200: "#F04438",
|
||||||
|
red300: "#D32F2F",
|
||||||
|
red700: "#542426",
|
||||||
|
red800: "#301A1F",
|
||||||
|
orange50: "#FEF8EA",
|
||||||
|
orange100: "#FFECBC",
|
||||||
|
orange200: "#FEC84B",
|
||||||
|
orange300: "#FDB022",
|
||||||
|
orange400: "#FF9F00",
|
||||||
|
orange500: "#E88C30",
|
||||||
|
orange600: "#DC6803",
|
||||||
|
orange800: "#624711",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* TODO Export this as colors */
|
const semanticColors = {
|
||||||
/* primary: {
|
primary: {
|
||||||
main: {
|
main: {
|
||||||
light:,
|
light: paletteColors.blueBlueWave,
|
||||||
dark:
|
dark: paletteColors.blueBlueWave,
|
||||||
},
|
},
|
||||||
light:{
|
// TODO we dont have primary light, dark or contrast text
|
||||||
light:,
|
|
||||||
dark:
|
|
||||||
},
|
},
|
||||||
|
secondary: {
|
||||||
|
main: {
|
||||||
|
light: paletteColors.gray100,
|
||||||
|
dark: paletteColors.gray800,
|
||||||
|
},
|
||||||
|
// TODO we dont have secondary light
|
||||||
dark: {
|
dark: {
|
||||||
light:,
|
light: paletteColors.gray200,
|
||||||
dark:
|
//TODO we dont have secondary dark for dark mode
|
||||||
|
},
|
||||||
|
constrastText: {
|
||||||
|
light: paletteColors.blue700,
|
||||||
|
//TODO we dont have secondary contrastText for dark mode
|
||||||
|
},
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
main: {
|
||||||
|
light: paletteColors.green200,
|
||||||
|
dark: paletteColors.green150,
|
||||||
},
|
},
|
||||||
contrastText: {
|
contrastText: {
|
||||||
light:,
|
//TODO values are equal (confirm)
|
||||||
dark:
|
//TODO contrasttext semantically should be something that contrasts with the main
|
||||||
|
light: paletteColors.green400,
|
||||||
|
dark: paletteColors.green400,
|
||||||
},
|
},
|
||||||
} */
|
light: {
|
||||||
const semanticColors = {
|
light: paletteColors.green50,
|
||||||
|
//TODO dark mode light success is darker than the main success
|
||||||
|
dark: paletteColors.green800,
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
light: paletteColors.green20,
|
||||||
|
dark: paletteColors.green900,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
error: {
|
||||||
|
main: {
|
||||||
|
light: paletteColors.red300,
|
||||||
|
dark: paletteColors.red300,
|
||||||
|
},
|
||||||
|
contrastText: {
|
||||||
|
//TODO contrasttext semantically should be something that contrasts with the main
|
||||||
|
light: paletteColors.red200,
|
||||||
|
dark: paletteColors.red200,
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
light: paletteColors.red100,
|
||||||
|
dark: paletteColors.red700,
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
light: paletteColors.red50,
|
||||||
|
dark: paletteColors.red800,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
warning: {
|
||||||
|
main: {
|
||||||
|
light: paletteColors.orange300,
|
||||||
|
dark: paletteColors.orange400,
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
light: paletteColors.orange600,
|
||||||
|
dark: paletteColors.orange500,
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
light: paletteColors.orange100,
|
||||||
|
dark: paletteColors.orange800,
|
||||||
|
},
|
||||||
|
bg: {
|
||||||
|
light: paletteColors.orange50,
|
||||||
|
dark: paletteColors.gray830,
|
||||||
|
},
|
||||||
|
border: {
|
||||||
|
light: paletteColors.orange200,
|
||||||
|
dark: paletteColors.orange500,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
gradient: {
|
gradient: {
|
||||||
color1: {
|
color1: {
|
||||||
light: paletteColors.gray90,
|
light: paletteColors.gray90,
|
||||||
|
|||||||
@@ -17,51 +17,43 @@ const background = {
|
|||||||
};
|
};
|
||||||
const border = { light: "#27272a", dark: "#36363e" };
|
const border = { light: "#27272a", dark: "#36363e" };
|
||||||
|
|
||||||
const { gradient } = colors;
|
const {
|
||||||
/* const gradient = {
|
primary,
|
||||||
color1: "#09090b",
|
secondary,
|
||||||
color2: "#0c0c0e",
|
success,
|
||||||
color3: "#0f0f11",
|
error,
|
||||||
color4: "#111113",
|
warning,
|
||||||
color5: "#131315",
|
gradient: {
|
||||||
}; */
|
color1: { dark: color1 },
|
||||||
|
color2: { dark: color2 },
|
||||||
|
color3: { dark: color3 },
|
||||||
|
color4: { dark: color4 },
|
||||||
|
color5: { dark: color5 },
|
||||||
|
},
|
||||||
|
} = colors;
|
||||||
|
|
||||||
const darkTheme = createTheme({
|
const darkTheme = createTheme({
|
||||||
...baseTheme,
|
...baseTheme,
|
||||||
palette: {
|
palette: {
|
||||||
primary: { main: "#1570ef" },
|
primary: { main: primary.main.dark },
|
||||||
secondary: { main: "#2D2D33" },
|
secondary: { main: secondary.main.dark },
|
||||||
text: text,
|
|
||||||
background: background,
|
|
||||||
border: border,
|
|
||||||
info: {
|
|
||||||
text: text.primary,
|
|
||||||
main: text.secondary,
|
|
||||||
bg: background.main,
|
|
||||||
light: background.main,
|
|
||||||
border: border.light,
|
|
||||||
},
|
|
||||||
gradient,
|
|
||||||
success: {
|
success: {
|
||||||
text: "#079455",
|
main: success.main.dark,
|
||||||
main: "#45bb7a",
|
contrastText: success.contrastText.dark,
|
||||||
light: "#1c4428",
|
light: success.light.dark,
|
||||||
bg: "#12261e",
|
dark: success.dark.dark,
|
||||||
},
|
},
|
||||||
error: {
|
error: {
|
||||||
text: "#f04438",
|
main: error.main.dark,
|
||||||
main: "#d32f2f",
|
contrastText: error.contrastText.dark,
|
||||||
light: "#542426",
|
light: error.light.dark,
|
||||||
bg: "#301a1f",
|
dark: error.dark.dark,
|
||||||
dark: "#932020",
|
|
||||||
border: "#f04438",
|
|
||||||
},
|
},
|
||||||
warning: {
|
warning: {
|
||||||
text: "#e88c30",
|
main: warning.main.dark,
|
||||||
main: "#FF9F00",
|
light: warning.light.dark,
|
||||||
light: "#624711",
|
contrastText: warning.contrastText.dark,
|
||||||
bg: "#262115",
|
dark: warning.dark.dark,
|
||||||
border: "#e88c30",
|
|
||||||
},
|
},
|
||||||
percentage: {
|
percentage: {
|
||||||
uptimePoor: "#d32f2f",
|
uptimePoor: "#d32f2f",
|
||||||
@@ -78,6 +70,23 @@ const darkTheme = createTheme({
|
|||||||
grid: "#454546",
|
grid: "#454546",
|
||||||
autofill: "#2d2d33",
|
autofill: "#2d2d33",
|
||||||
},
|
},
|
||||||
|
gradient: {
|
||||||
|
color1,
|
||||||
|
color2,
|
||||||
|
color3,
|
||||||
|
color4,
|
||||||
|
color5,
|
||||||
|
},
|
||||||
|
text: text,
|
||||||
|
background: background,
|
||||||
|
border: border,
|
||||||
|
info: {
|
||||||
|
text: text.primary,
|
||||||
|
main: text.secondary,
|
||||||
|
bg: background.main,
|
||||||
|
light: background.main,
|
||||||
|
border: border.light,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -15,52 +15,49 @@ const background = {
|
|||||||
accent: "#f9fafb",
|
accent: "#f9fafb",
|
||||||
};
|
};
|
||||||
|
|
||||||
const { gradient } = colors;
|
|
||||||
/* const gradient = {
|
|
||||||
color1: "#fcfcfd",
|
|
||||||
color2: "#fdfcfd",
|
|
||||||
color3: "#fdfdfd",
|
|
||||||
color4: "#fefdfe",
|
|
||||||
color5: "#fefefe",
|
|
||||||
}; */
|
|
||||||
|
|
||||||
const border = { light: "#eaecf0", dark: "#d0d5dd" };
|
const border = { light: "#eaecf0", dark: "#d0d5dd" };
|
||||||
|
|
||||||
|
const {
|
||||||
|
primary,
|
||||||
|
secondary,
|
||||||
|
success,
|
||||||
|
error,
|
||||||
|
warning,
|
||||||
|
gradient: {
|
||||||
|
color1: { light: color1 },
|
||||||
|
color2: { light: color2 },
|
||||||
|
color3: { light: color3 },
|
||||||
|
color4: { light: color4 },
|
||||||
|
color5: { light: color5 },
|
||||||
|
},
|
||||||
|
} = colors;
|
||||||
|
|
||||||
const lightTheme = createTheme({
|
const lightTheme = createTheme({
|
||||||
...baseTheme,
|
...baseTheme,
|
||||||
palette: {
|
palette: {
|
||||||
primary: { main: "#1570EF" },
|
primary: { main: primary.main.light },
|
||||||
secondary: { main: "#F4F4F4", dark: "#e3e3e3", contrastText: "#475467" },
|
secondary: {
|
||||||
text: text,
|
main: secondary.main.light,
|
||||||
background: background,
|
dark: secondary.dark.light,
|
||||||
border: border,
|
contrastText: secondary.constrastText.light,
|
||||||
info: {
|
|
||||||
text: text.primary,
|
|
||||||
main: text.tertiary,
|
|
||||||
bg: background.main,
|
|
||||||
light: background.main,
|
|
||||||
border: border.dark,
|
|
||||||
},
|
},
|
||||||
gradient,
|
|
||||||
success: {
|
success: {
|
||||||
text: "#079455",
|
main: success.main.light,
|
||||||
main: "#17b26a",
|
contrastText: success.contrastText.light,
|
||||||
light: "#d4f4e1",
|
light: success.light.light,
|
||||||
bg: "#ecfdf3",
|
dark: success.dark.light,
|
||||||
},
|
},
|
||||||
error: {
|
error: {
|
||||||
text: "#f04438",
|
main: error.main.light,
|
||||||
main: "#d32f2f",
|
contrastText: error.contrastText.light,
|
||||||
light: "#fbd1d1",
|
light: error.light.light,
|
||||||
bg: "#f9eced",
|
dark: error.dark.light,
|
||||||
border: "#f04438",
|
|
||||||
},
|
},
|
||||||
warning: {
|
warning: {
|
||||||
text: "#DC6803",
|
main: warning.main.light,
|
||||||
main: "#fdb022",
|
light: warning.light.light,
|
||||||
light: "#ffecbc",
|
contrastText: warning.contrastText.light,
|
||||||
bg: "#fef8ea",
|
dark: warning.dark.light,
|
||||||
border: "#fec84b",
|
|
||||||
},
|
},
|
||||||
percentage: {
|
percentage: {
|
||||||
uptimePoor: "#d32f2f",
|
uptimePoor: "#d32f2f",
|
||||||
@@ -77,6 +74,23 @@ const lightTheme = createTheme({
|
|||||||
grid: "#a2a3a3",
|
grid: "#a2a3a3",
|
||||||
autofill: "#e8f0fe",
|
autofill: "#e8f0fe",
|
||||||
},
|
},
|
||||||
|
gradient: {
|
||||||
|
color1,
|
||||||
|
color2,
|
||||||
|
color3,
|
||||||
|
color4,
|
||||||
|
color5,
|
||||||
|
},
|
||||||
|
text: text,
|
||||||
|
background: background,
|
||||||
|
border: border,
|
||||||
|
info: {
|
||||||
|
text: text.primary,
|
||||||
|
main: text.tertiary,
|
||||||
|
bg: background.main,
|
||||||
|
light: background.main,
|
||||||
|
border: border.dark,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user