refactor page speed
This commit is contained in:
1 parent
220fc080e6
commit
3a76fa77dd
1 file changed
+39
-58
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Button, Modal, Stack, Tooltip, Typography } from "@mui/material";
|
import { Box, Button, Stack, Tooltip, Typography } from "@mui/material";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useNavigate, useParams } from "react-router";
|
import { useNavigate, useParams } from "react-router";
|
||||||
import {
|
import {
|
||||||
@@ -25,6 +25,7 @@ import PlayCircleOutlineRoundedIcon from "@mui/icons-material/PlayCircleOutlineR
|
|||||||
import SkeletonLayout from "./skeleton";
|
import SkeletonLayout from "./skeleton";
|
||||||
import useUtils from "../../Monitors/utils";
|
import useUtils from "../../Monitors/utils";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
import { GenericDialog } from "../../../Components/Dialog/genericDialog";
|
||||||
|
|
||||||
const PageSpeedConfigure = () => {
|
const PageSpeedConfigure = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -428,69 +429,49 @@ const PageSpeedConfigure = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<Modal
|
<GenericDialog
|
||||||
aria-labelledby="modal-delete-pagespeed-monitor"
|
title={"modal-delete-pagespeed-monitor"}
|
||||||
aria-describedby="delete-pagespeed-monitor-confirmation"
|
description={"delete-pagespeed-monitor-confirmation"}
|
||||||
open={isOpen}
|
open={isOpen}
|
||||||
onClose={() => setIsOpen(false)}
|
close={() => setIsOpen(false)}
|
||||||
disablePortal
|
theme={theme}
|
||||||
>
|
>
|
||||||
<Stack
|
<Typography
|
||||||
gap={theme.spacing(2)}
|
id="modal-delete-pagespeed-monitor"
|
||||||
sx={{
|
component="h2"
|
||||||
position: "absolute",
|
variant="h2"
|
||||||
top: "50%",
|
fontWeight={500}
|
||||||
left: "50%",
|
|
||||||
transform: "translate(-50%, -50%)",
|
|
||||||
width: 400,
|
|
||||||
bgcolor: theme.palette.background.main,
|
|
||||||
border: 1,
|
|
||||||
borderColor: theme.palette.border.light,
|
|
||||||
borderRadius: theme.shape.borderRadius,
|
|
||||||
boxShadow: 24,
|
|
||||||
p: theme.spacing(15),
|
|
||||||
"&:focus": {
|
|
||||||
outline: "none",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Typography
|
Do you really want to delete this monitor?
|
||||||
id="modal-delete-pagespeed-monitor"
|
</Typography>
|
||||||
component="h2"
|
<Typography
|
||||||
variant="h2"
|
id="delete-pagespeed-monitor-confirmation"
|
||||||
fontWeight={500}
|
variant="body1"
|
||||||
|
>
|
||||||
|
Once deleted, this monitor cannot be retrieved.
|
||||||
|
</Typography>
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
gap={theme.spacing(4)}
|
||||||
|
mt={theme.spacing(12)}
|
||||||
|
justifyContent="flex-end"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
variant="text"
|
||||||
|
color="info"
|
||||||
|
onClick={() => setIsOpen(false)}
|
||||||
>
|
>
|
||||||
Do you really want to delete this monitor?
|
Cancel
|
||||||
</Typography>
|
</Button>
|
||||||
<Typography
|
<Button
|
||||||
id="delete-pagespeed-monitor-confirmation"
|
variant="contained"
|
||||||
variant="body1"
|
color="error"
|
||||||
|
onClick={handleRemove}
|
||||||
>
|
>
|
||||||
Once deleted, this monitor cannot be retrieved.
|
Delete
|
||||||
</Typography>
|
</Button>
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
gap={theme.spacing(4)}
|
|
||||||
mt={theme.spacing(12)}
|
|
||||||
justifyContent="flex-end"
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
color="info"
|
|
||||||
onClick={() => setIsOpen(false)}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="error"
|
|
||||||
onClick={handleRemove}
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</GenericDialog>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user