Refactored status dot to its own component

This commit is contained in:
Daniel Cojocea committed 2024-08-22 12:23:52 -04:00
1 parent 35ae180865
commit 50c23505c3
5 files changed
+77 -122

No files matched your search

+9 -30
View File
@@ -10,15 +10,14 @@ import {
} from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice";
import { monitorValidation } from "../../../Validation/validation";
import { createToast } from "../../../Utils/toastUtils";
import { logger } from "../../../Utils/Logger";
import Button from "../../../Components/Button";
import Field from "../../../Components/Inputs/Field";
import Select from "../../../Components/Inputs/Select";
import Checkbox from "../../../Components/Inputs/Checkbox";
import PauseCircleOutlineIcon from "@mui/icons-material/PauseCircleOutline";
import GreenCheck from "../../../assets/icons/checkbox-green.svg?react";
import RedCheck from "../../../assets/icons/checkbox-red.svg?react";
import Breadcrumbs from "../../../Components/Breadcrumbs";
import { logger } from "../../../Utils/Logger";
import PulseDot from "../../../Components/Animated/PulseDot";
import "./index.css";
@@ -169,33 +168,13 @@ const PageSpeedConfigure = () => {
gap={theme.gap.large}
>
<Stack direction="row" gap={theme.gap.xs}>
<Stack
width={theme.gap.large}
height={theme.gap.large}
alignItems="center"
justifyContent="center"
>
<Box
width="14px"
height="14px"
sx={{
position: "relative",
backgroundColor: monitor?.status
? theme.label.up.dotColor
: theme.label.down.dotColor,
borderRadius: "50%",
"&::before": {
content: `""`,
position: "absolute",
width: "100%",
height: "100%",
backgroundColor: "inherit",
borderRadius: "50%",
animation: "ripple 1.8s ease-out infinite",
},
}}
/>
</Stack>
<PulseDot
color={
monitor?.status
? theme.label.up.dotColor
: theme.label.down.dotColor
}
/>
<Box>
<Typography
component="h1"
+8 -27
View File
@@ -19,6 +19,7 @@ import ClockIcon from "../../../assets/icons/maintenance.svg?react";
import IntervalCheckIcon from "../../../assets/icons/interval-check.svg?react";
import PageSpeedLineChart from "../../../Components/Charts/PagespeedLineChart";
import Breadcrumbs from "../../../Components/Breadcrumbs";
import PulseDot from "../../../Components/Animated/PulseDot";
import "./index.css";
const StatBox = ({ icon, title, value }) => {
@@ -324,33 +325,13 @@ const PageSpeedDetails = () => {
]}
/>
<Stack direction="row" gap={theme.gap.xs}>
<Stack
width={theme.gap.large}
height={theme.gap.large}
alignItems="center"
justifyContent="center"
>
<Box
width="14px"
height="14px"
sx={{
position: "relative",
backgroundColor: monitor?.status
? theme.label.up.dotColor
: theme.label.down.dotColor,
borderRadius: "50%",
"&::before": {
content: `""`,
position: "absolute",
width: "100%",
height: "100%",
backgroundColor: "inherit",
borderRadius: "50%",
animation: "ripple 1.8s ease-out infinite",
},
}}
/>
</Stack>
<PulseDot
color={
monitor?.status
? theme.label.up.dotColor
: theme.label.down.dotColor
}
/>
<Box>
<Typography
component="h1"