refactor: removing dupicity of onCancel and onClose

This commit is contained in:
Caio Cabral committed 2024-10-22 11:56:12 -04:00
1 parent 02d65bd0bc
commit f0c1d30de0
7 files changed
+1 -12

No files matched your search

+1 -2
View File
@@ -7,7 +7,6 @@ const Dialog = ({
title, title,
description, description,
open, open,
onClose,
theme, theme,
onCancel, onCancel,
confirmationButtonLabel, confirmationButtonLabel,
@@ -19,7 +18,7 @@ const Dialog = ({
title={title} title={title}
description={description} description={description}
open={open} open={open}
onClose={onClose} onClose={onCancel}
theme={theme} theme={theme}
> >
<Stack <Stack
@@ -374,7 +374,6 @@ const ProfilePanel = () => {
<Dialog <Dialog
open={isModalOpen("delete")} open={isModalOpen("delete")}
onClose={() => setIsOpen("")}
theme={theme} theme={theme}
title={"Really delete this account?"} title={"Really delete this account?"}
description={ description={
@@ -150,10 +150,6 @@ const ActionsMenu = ({ /* isAdmin, */ maintenanceWindow, updateCallback }) => {
</Menu> </Menu>
<Dialog <Dialog
open={isOpen} open={isOpen}
onClose={(e) => {
e.stopPropagation();
setIsOpen(false);
}}
theme={theme} theme={theme}
title={"Do you really want to remove this maintenance window?"} title={"Do you really want to remove this maintenance window?"}
onCancel={(e) => { onCancel={(e) => {
@@ -456,7 +456,6 @@ const Configure = () => {
<Dialog <Dialog
open={isOpen} open={isOpen}
onClose={() => setIsOpen(false)}
theme={theme} theme={theme}
title="Do you really want to delete this monitor?" title="Do you really want to delete this monitor?"
description="Once deleted, this monitor cannot be retrieved." description="Once deleted, this monitor cannot be retrieved."
@@ -189,7 +189,6 @@ const ActionsMenu = ({ monitor, isAdmin, updateCallback }) => {
</Menu> </Menu>
<Dialog <Dialog
open={isOpen} open={isOpen}
onClose={() => setIsOpen(false)}
theme={theme} theme={theme}
title="Do you really want to delete this monitor?" title="Do you really want to delete this monitor?"
description="Once deleted, this monitor cannot be retrieved." description="Once deleted, this monitor cannot be retrieved."
@@ -434,7 +434,6 @@ const PageSpeedConfigure = () => {
)} )}
<Dialog <Dialog
open={isOpen} open={isOpen}
onClose={() => setIsOpen(false)}
theme={theme} theme={theme}
title={"Do you really want to delete this monitor?"} title={"Do you really want to delete this monitor?"}
description={"Once deleted, this monitor cannot be retrieved."} description={"Once deleted, this monitor cannot be retrieved."}
-2
View File
@@ -264,7 +264,6 @@ const Settings = ({ isAdmin }) => {
</Stack> </Stack>
<Dialog <Dialog
open={isOpen.deleteStats} open={isOpen.deleteStats}
onClose={() => setIsOpen(deleteStatsMonitorsInitState)}
theme={theme} theme={theme}
title="Do you want to clear all stats?" title="Do you want to clear all stats?"
description="Once deleted, this monitor cannot be retrieved." description="Once deleted, this monitor cannot be retrieved."
@@ -313,7 +312,6 @@ const Settings = ({ isAdmin }) => {
</Stack> </Stack>
<Dialog <Dialog
open={isOpen.deleteMonitors} open={isOpen.deleteMonitors}
onClose={() => setIsOpen(deleteStatsMonitorsInitState)}
theme={theme} theme={theme}
title="Do you want to remove all monitors?" title="Do you want to remove all monitors?"
onCancel={() => setIsOpen(deleteStatsMonitorsInitState)} onCancel={() => setIsOpen(deleteStatsMonitorsInitState)}