Fixed pulse dot not displaying accurate status color
This commit is contained in:
1 parent
62e7eab8a3
commit
60ffc2f1d2
1 file changed
+4
-12
@@ -29,11 +29,13 @@ import PulseDot from "../../../Components/Animated/PulseDot";
|
|||||||
import PagespeedDetailsAreaChart from "./Charts/AreaChart";
|
import PagespeedDetailsAreaChart from "./Charts/AreaChart";
|
||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
import PieChart from "./Charts/PieChart";
|
import PieChart from "./Charts/PieChart";
|
||||||
|
import useUtils from "../../Monitors/utils";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const PageSpeedDetails = () => {
|
const PageSpeedDetails = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const { statusColor, pagespeedStatusMsg, determineState } = useUtils();
|
||||||
const [monitor, setMonitor] = useState({});
|
const [monitor, setMonitor] = useState({});
|
||||||
const [audits, setAudits] = useState({});
|
const [audits, setAudits] = useState({});
|
||||||
const { monitorId } = useParams();
|
const { monitorId } = useParams();
|
||||||
@@ -109,11 +111,7 @@ const PageSpeedDetails = () => {
|
|||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={
|
title={pagespeedStatusMsg[determineState(monitor)]}
|
||||||
monitor?.status
|
|
||||||
? "Your pagespeed monitor is live."
|
|
||||||
: "Your pagespeed monitor is down."
|
|
||||||
}
|
|
||||||
disableInteractive
|
disableInteractive
|
||||||
slotProps={{
|
slotProps={{
|
||||||
popper: {
|
popper: {
|
||||||
@@ -129,13 +127,7 @@ const PageSpeedDetails = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
<PulseDot
|
<PulseDot color={statusColor[determineState(monitor)]} />
|
||||||
color={
|
|
||||||
monitor?.status
|
|
||||||
? theme.palette.success.main
|
|
||||||
: theme.palette.error.main
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Box>
|
</Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Typography component="h2" variant="h2">
|
<Typography component="h2" variant="h2">
|
||||||
|
|||||||
Reference in new issue
Block a user