From c7d2545ec7bbcdba30b775453d53df5a359410bd Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Thu, 21 Sep 2023 15:35:27 +0800
Subject: Revert dialog.

---
 FrontEnd/src/components/dialog/ConfirmDialog.tsx | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'FrontEnd/src/components/dialog/ConfirmDialog.tsx')

diff --git a/FrontEnd/src/components/dialog/ConfirmDialog.tsx b/FrontEnd/src/components/dialog/ConfirmDialog.tsx
index 8b0a4219..4ee0ec03 100644
--- a/FrontEnd/src/components/dialog/ConfirmDialog.tsx
+++ b/FrontEnd/src/components/dialog/ConfirmDialog.tsx
@@ -2,14 +2,17 @@ import { useC, Text, ThemeColor } from "../common";
 
 import Dialog from "./Dialog";
 import DialogContainer from "./DialogContainer";
-import { useCloseDialog } from "./DialogProvider";
 
 export default function ConfirmDialog({
+  open,
+  onClose,
   onConfirm,
   title,
   body,
   color,
 }: {
+  open: boolean;
+  onClose: () => void;
   onConfirm: () => void;
   title: Text;
   body: Text;
@@ -18,10 +21,8 @@ export default function ConfirmDialog({
 }) {
   const c = useC();
 
-  const closeDialog = useCloseDialog();
-
   return (
-    <Dialog color={color ?? "danger"}>
+    <Dialog open={open} onClose={onClose} color={color ?? "danger"}>
       <DialogContainer
         title={title}
         titleColor={color ?? "danger"}
@@ -32,7 +33,7 @@ export default function ConfirmDialog({
             action: "minor",
 
             text: "operationDialog.cancel",
-            onClick: closeDialog,
+            onClick: onClose,
           },
           {
             key: "confirm",
@@ -42,7 +43,7 @@ export default function ConfirmDialog({
             color: "danger",
             onClick: () => {
               onConfirm();
-              closeDialog();
+              onClose();
             },
           },
         ]}
-- 
cgit v1.2.3

