ar-design 0.3.18 → 0.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,7 @@ import Button from "../../form/button";
|
|
|
5
5
|
import ReactDOM from "react-dom";
|
|
6
6
|
import { NotificationContext } from "../../../libs/core/application/contexts/Notification";
|
|
7
7
|
import { ARIcon } from "../../icons";
|
|
8
|
+
import Box from "../../data-display/grid-system/box/Box";
|
|
8
9
|
const Popup = ({ title, message, status, isOpen, buttons }) => {
|
|
9
10
|
// contexts
|
|
10
11
|
const { setIsPopupOpen } = useContext(NotificationContext);
|
|
@@ -74,11 +75,18 @@ const Popup = ({ title, message, status, isOpen, buttons }) => {
|
|
|
74
75
|
title,
|
|
75
76
|
"!"),
|
|
76
77
|
React.createElement("span", { className: "message" }, message)),
|
|
77
|
-
React.createElement(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
React.createElement(Box, null,
|
|
79
|
+
React.createElement(Button, { variant: "filled", color: buttonColor(), onClick: () => {
|
|
80
|
+
(() => buttons?.okay?.onClick && buttons.okay?.onClick())();
|
|
81
|
+
(() => {
|
|
82
|
+
setIsPopupOpen && setIsPopupOpen((prev) => !prev);
|
|
83
|
+
})();
|
|
84
|
+
} }, buttons?.okay?.text ?? "Tamam"),
|
|
85
|
+
buttons?.cancel && (React.createElement(Button, { variant: "filled", color: "light", onClick: () => {
|
|
86
|
+
(() => buttons?.cancel?.onClick && buttons.cancel?.onClick())();
|
|
87
|
+
(() => {
|
|
88
|
+
setIsPopupOpen && setIsPopupOpen((prev) => !prev);
|
|
89
|
+
})();
|
|
90
|
+
} }, buttons?.cancel?.text ?? "İptal"))))), document.body));
|
|
83
91
|
};
|
|
84
92
|
export default Popup;
|