Skip to content

Commit

Permalink
feat: add Modal property: bodyHeight, delete size following external …
Browse files Browse the repository at this point in the history
…container
  • Loading branch information
bzone authored and bzone committed Sep 21, 2019
1 parent d1f3f5d commit 86daa33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
12 changes: 1 addition & 11 deletions code/Feedback/Modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,4 @@
width: initial;
margin: initial;
padding-bottom: initial;
}

.ant-modal-content {
height: 100%;
display: flex;
flex-direction: column;
}

.ant-modal-body {
flex-grow: 1;
}
}
8 changes: 6 additions & 2 deletions code/Feedback/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,28 @@ const controlProperty: PropertyControls = {
// 对话框是否可见 boolean 无
visible: {
type: ControlType.Boolean
},
bodyHeight: {
type: ControlType.Number
}
};

export const Modal = props => {
const { width, height, ...rest } = props;
const { width, bodyHeight, ...rest } = props;
return (
<AntModal
{...pick(rest, keys(controlProperty))}
mask={false}
getContainer={false}
style={{ height }}
bodyStyle={{ height: bodyHeight }}
/>
);
};

Modal.defaultProps = {
width: 520,
height: 450,
bodyHeight: 300,
title: "title",
// 垂直居中展示 Modal Boolean false 3.8.0
centered: false,
Expand Down

0 comments on commit 86daa33

Please sign in to comment.