Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add closable option for confirm dialog #798

Merged
merged 1 commit into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/modal/ConfirmDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
maskStyle,
okButtonProps,
cancelButtonProps,
closable = false,
} = props;
const iconType = props.iconType || 'question-circle';
const okType = props.okType || 'primary';
Expand Down Expand Up @@ -62,6 +63,7 @@ export default {
wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })}
onCancel={e => close({ triggerCancel: true }, e)}
visible={visible}
closable={closable}
title=""
transitionName="zoom"
footer=""
Expand Down
1 change: 1 addition & 0 deletions components/modal/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The properties of the object are follows:
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
| cancelText | Text of the Cancel button | string | `Cancel` |
| centered | Centered Modal | Boolean | `false` |
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `false` |
| class | class of container | string | - |
| content | Content | string\|vNode | - |
| iconType | Icon `type` of the Icon component | string | `question-circle` |
Expand Down
1 change: 1 addition & 0 deletions components/modal/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
| cancelText | 取消按钮文字 | string | 取消 |
| centered | 垂直居中展示 Modal | Boolean | `false` |
| closable | 是否显示右上角的关闭按钮 | boolean | `false` |
| class | 容器类名 | string | - |
| content | 内容 | string\|vNode | 无 |
| iconType | 图标 Icon 类型 | string | question-circle |
Expand Down
4 changes: 0 additions & 4 deletions components/modal/style/confirm.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
display: none;
}

.@{ant-prefix}-modal-close {
display: none;
}

.@{ant-prefix}-modal-body {
padding: 32px 32px 24px;
}
Expand Down