1 | import OriginModal, { destroyFns } from './Modal';
|
2 | import confirm, { withWarn, withInfo, withSuccess, withError, withConfirm } from './confirm';
|
3 |
|
4 | function modalWarn(props) {
|
5 | return confirm(withWarn(props));
|
6 | }
|
7 |
|
8 | var Modal = OriginModal;
|
9 |
|
10 | Modal.info = function infoFn(props) {
|
11 | return confirm(withInfo(props));
|
12 | };
|
13 |
|
14 | Modal.success = function successFn(props) {
|
15 | return confirm(withSuccess(props));
|
16 | };
|
17 |
|
18 | Modal.error = function errorFn(props) {
|
19 | return confirm(withError(props));
|
20 | };
|
21 |
|
22 | Modal.warning = modalWarn;
|
23 | Modal.warn = modalWarn;
|
24 |
|
25 | Modal.confirm = function confirmFn(props) {
|
26 | return confirm(withConfirm(props));
|
27 | };
|
28 |
|
29 | Modal.destroyAll = function destroyAllFn() {
|
30 | while (destroyFns.length) {
|
31 | var close = destroyFns.pop();
|
32 |
|
33 | if (close) {
|
34 | close();
|
35 | }
|
36 | }
|
37 | };
|
38 |
|
39 | export default Modal; |
\ | No newline at end of file |