resolve conflict.

This commit is contained in:
HeskeyBaozi 2018-08-02 18:02:43 +08:00
parent cc180e2605
commit 46cb1c8cde
2 changed files with 45 additions and 3 deletions

View File

@ -7,12 +7,12 @@ import Button from '../button';
import { ButtonType, NativeButtonProps } from '../button/button';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import { getConfirmLocale } from './locale';
import Icon from '../icon';
let mousePosition: { x: number, y: number } | null;
let mousePositionEventBinded: boolean;
export interface ModalProps {
prefixCls?: string;
/** 对话框是否可见*/
visible?: boolean;
/** 确定按钮 loading*/
@ -55,6 +55,7 @@ export interface ModalProps {
mask?: boolean;
keyboard?: boolean;
wrapProps?: any;
prefixCls?: string;
}
export interface ModalFuncProps {
@ -192,6 +193,12 @@ export default class Modal extends React.Component<ModalProps, {}> {
</LocaleReceiver>
);
const closeIcon = (
<span className={`${prefixCls}-close-x`}>
<Icon className={`${prefixCls}-close-icon`} type={'close'}/>
</span>
);
return (
<Dialog
{...restProps}
@ -201,6 +208,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
visible={visible}
mousePosition={mousePosition}
onClose={this.handleCancel}
closeIcon={closeIcon}
/>
);
}

View File

@ -26,7 +26,24 @@ exports[`Modal render correctly 1`] = `
>
<span
class="ant-modal-close-x"
/>
>
<i
class="anticon ant-modal-close-icon"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</i>
</span>
</button>
<div
class="ant-modal-body"
@ -94,7 +111,24 @@ exports[`Modal render without footer 1`] = `
>
<span
class="ant-modal-close-x"
/>
>
<i
class="anticon ant-modal-close-icon"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</i>
</span>
</button>
<div
class="ant-modal-body"