@cashub/ui 0.48.8 → 0.48.10
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.
- package/modal/StateModal.js +10 -5
- package/package.json +1 -1
package/modal/StateModal.js
CHANGED
|
@@ -53,12 +53,14 @@ const ModalContent = _ref2 => {
|
|
|
53
53
|
text,
|
|
54
54
|
confirmButtonText,
|
|
55
55
|
cancelButtonText,
|
|
56
|
+
showConfirmButton = true,
|
|
56
57
|
showCancelButton,
|
|
57
58
|
onClose,
|
|
58
59
|
onConfirm,
|
|
59
60
|
onCancel,
|
|
60
61
|
allowDismiss = true,
|
|
61
|
-
cancelButtonType = 'danger'
|
|
62
|
+
cancelButtonType = 'danger',
|
|
63
|
+
confirmButtonType = 'success'
|
|
62
64
|
} = _ref2;
|
|
63
65
|
const refWrapper = (0, _react.useRef)(null);
|
|
64
66
|
const [id] = (0, _react.useState)((0, _lodash.default)('SD-'));
|
|
@@ -94,7 +96,7 @@ const ModalContent = _ref2 => {
|
|
|
94
96
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, {
|
|
95
97
|
children: text
|
|
96
98
|
})]
|
|
97
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
|
|
99
|
+
}), (showCancelButton === true || showConfirmButton === true) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
|
|
98
100
|
alignRight: true,
|
|
99
101
|
children: [showCancelButton === true && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread(_objectSpread(_objectSpread({}, cancelButtonType === 'danger' && {
|
|
100
102
|
danger: true
|
|
@@ -103,11 +105,14 @@ const ModalContent = _ref2 => {
|
|
|
103
105
|
}), {}, {
|
|
104
106
|
onClick: handleCancel,
|
|
105
107
|
children: cancelButtonText || 'Cancel'
|
|
106
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
107
|
-
success: true
|
|
108
|
+
})), showConfirmButton === true && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread(_objectSpread(_objectSpread({}, confirmButtonType === 'success' && {
|
|
109
|
+
success: true
|
|
110
|
+
}), confirmButtonType === 'warning' && {
|
|
111
|
+
warning: true
|
|
112
|
+
}), {}, {
|
|
108
113
|
onClick: handleConfirm,
|
|
109
114
|
children: confirmButtonText || 'Confirm'
|
|
110
|
-
})]
|
|
115
|
+
}))]
|
|
111
116
|
})]
|
|
112
117
|
})
|
|
113
118
|
});
|