This commit is contained in:
Alex Holliday committed 2025-02-24 14:33:25 -08:00
1 parent c94c0261ab
commit 88fc158d9f
23 files changed
+251 -228

No files matched your search

+2 -6
View File
@@ -31,9 +31,7 @@ const ActionsMenu = ({
event.preventDefault();
event.stopPropagation();
let monitor = { _id: actions.id };
const action = await dispatch(
deleteUptimeMonitor({ monitor })
);
const action = await dispatch(deleteUptimeMonitor({ monitor }));
if (action.meta.requestStatus === "fulfilled") {
setIsOpen(false); // close modal
updateRowCallback();
@@ -46,9 +44,7 @@ const ActionsMenu = ({
const handlePause = async () => {
try {
setIsLoading(true);
const action = await dispatch(
pauseUptimeMonitor({ monitorId: monitor._id })
);
const action = await dispatch(pauseUptimeMonitor({ monitorId: monitor._id }));
if (pauseUptimeMonitor.fulfilled.match(action)) {
const state = action?.payload?.data.isActive === false ? "paused" : "resumed";
createToast({ body: `Monitor ${state} successfully.` });
+8 -26
View File
@@ -13,10 +13,8 @@ import { RowContainer } from "../StandardContainer";
* @param {number} props.headerLevel - Font characteristic of the header
* @param {string} props.subHeaderText - Subheader text
* @param {number} props.subHeaderLevel - Font characteristic of the subheader
* @param {string} props.rightCatagoryTitle - Message for right section
* @param {number} props.rightCatagoryTitleLevel - Font characteristic of the right section header
* @param {string} props.rightDescription - Description for right section
* @param {number} props.rightDescriptionLevel - Font characteristic of the right section description
* @param {string} props.alignItems - Align items
* @param {node} props.children - Children
* @returns {JSX.Element} The rendered component
*/
@@ -25,16 +23,14 @@ const SubHeader = ({
headerLevel = 1,
subHeaderText,
subHeaderLevel = 1,
rightCatagoryTitle,
rightCatagoryTitleLevel = 2,
rightDescription,
rightDescriptionLevel = 2,
alignItems = "center",
children,
}) => {
const theme = useTheme();
return (
<Stack
direction="row"
alignItems={alignItems}
justifyContent="space-between"
>
<Stack direction={"column"}>
@@ -58,19 +54,7 @@ const SubHeader = ({
{subHeaderText}
</Typography>
</Stack>
{rightCatagoryTitle && (
<RowContainer sx={{ width: "20%" }}>
<Stack>
<Typography variant={`body${rightCatagoryTitleLevel}`}>
{rightCatagoryTitle}
</Typography>
<Typography variant={`h${rightDescriptionLevel}`}>
{rightDescription}
</Typography>
</Stack>
</RowContainer>
)}
{children}
</Stack>
);
};
@@ -80,10 +64,8 @@ SubHeader.propTypes = {
headerLevel: PropTypes.number,
subHeaderText: PropTypes.string,
subHeaderLevel: PropTypes.number,
rightCatagoryTitle: PropTypes.string,
rightCatagoryTitleLevel: PropTypes.number,
rightDescription: PropTypes.string,
rightDescriptionLevel: PropTypes.number,
alignItems: PropTypes.string,
children: PropTypes.node,
};
export default SubHeader;