ant-design/components/modal/index.tsx
2016-06-22 13:19:48 +08:00

49 lines
997 B
TypeScript

import Modal from './Modal';
import confirm from './confirm';
import assign from 'object-assign';
Modal.info = function (props) {
const config = assign({}, {
type: 'info',
iconType: 'info-circle',
okCancel: false,
}, props);
return confirm(config);
};
Modal.success = function (props) {
const config = assign({}, {
type: 'success',
iconType: 'check-circle',
okCancel: false,
}, props);
return confirm(config);
};
Modal.error = function (props) {
const config = assign({}, {
type: 'error',
iconType: 'cross-circle',
okCancel: false,
}, props);
return confirm(config);
};
Modal.warning = Modal.warn = function (props) {
const config = assign({}, {
type: 'warning',
iconType: 'exclamation-circle',
okCancel: false,
}, props);
return confirm(config);
};
Modal.confirm = function (props) {
const config = assign({}, {
type: 'confirm',
okCancel: true,
}, props);
return confirm(config);
};
export default Modal;