ant-design/components/modal/index.tsx

57 lines
1.1 KiB
TypeScript
Raw Normal View History

import Modal, { ModalFuncProps } from './Modal';
2015-09-07 11:48:57 +08:00
import confirm from './confirm';
export { ActionButtonProps } from './ActionButton';
export { ModalProps, ModalFuncProps } from './Modal';
Modal.info = function (props: ModalFuncProps) {
const config = {
type: 'info',
iconType: 'info-circle',
okCancel: false,
...props,
};
return confirm(config);
2015-09-07 11:48:57 +08:00
};
Modal.success = function (props: ModalFuncProps) {
const config = {
type: 'success',
iconType: 'check-circle',
okCancel: false,
...props,
};
return confirm(config);
2015-09-07 11:48:57 +08:00
};
Modal.error = function (props: ModalFuncProps) {
const config = {
type: 'error',
iconType: 'close-circle',
okCancel: false,
...props,
};
return confirm(config);
2015-09-07 11:48:57 +08:00
};
Modal.warning = Modal.warn = function (props: ModalFuncProps) {
const config = {
2016-04-11 14:59:37 +08:00
type: 'warning',
iconType: 'exclamation-circle',
okCancel: false,
...props,
};
2016-04-11 14:59:37 +08:00
return confirm(config);
};
Modal.confirm = function (props: ModalFuncProps) {
const config = {
type: 'confirm',
okCancel: true,
...props,
};
return confirm(config);
2015-09-07 11:48:57 +08:00
};
export default Modal;