Skip to content

Commit

Permalink
docs: 去掉多余的demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoneybee committed Sep 2, 2020
1 parent ae83be3 commit 51ffda1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 66 deletions.
28 changes: 8 additions & 20 deletions components/modal/__tests__/__snapshots__/demo.test.js.snap
Expand Up @@ -284,26 +284,14 @@ exports[`renders ./components/modal/demo/manual.md correctly 1`] = `
`;

exports[`renders ./components/modal/demo/modal-render.md correctly 1`] = `
Array [
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Custom modal content render
</span>
</button>,
<br />,
<br />,
<button
class="ant-btn"
type="button"
>
<span>
Open Draggable Modal
</span>
</button>,
]
<button
class="ant-btn"
type="button"
>
<span>
Open Draggable Modal
</span>
</button>
`;

exports[`renders ./components/modal/demo/position.md correctly 1`] = `
Expand Down
46 changes: 0 additions & 46 deletions components/modal/demo/modal-render.md
Expand Up @@ -21,7 +21,6 @@ class App extends React.Component {
state = {
visible: false,
disabled: true,
customVisible: false,
};

showModal = () => {
Expand All @@ -30,26 +29,6 @@ class App extends React.Component {
});
};

showCustomRender = () => {
this.setState({
customVisible: true,
});
}

handleCustomOk = e => {
console.log(e);
this.setState({
customVisible: false,
});
};

handleCustomCancel = e => {
console.log(e);
this.setState({
customVisible: false,
});
};

handleOk = e => {
console.log(e);
this.setState({
Expand All @@ -64,37 +43,12 @@ class App extends React.Component {
});
};


render() {
return (
<>
<Button type="primary" onClick={this.showCustomRender}>
Custom modal content render
</Button>
<br/>
<br/>
<Button onClick={this.showModal}>
Open Draggable Modal
</Button>
<Modal
title="Custom modal content render"
visible={this.state.customVisible}
onOk={this.handleCustomOk}
onCancel={this.handleCustomCancel}
modalRender={node => {
return React.cloneElement(node, {
...node.props,
style: { opacity: .5 },
})
}}
>
<p>
Just don&apos;t learn physics at school and your life will be full of magic and
miracles.
</p>
<br />
<p>Day before yesterday I saw a rabbit, and yesterday a deer, and today, you.</p>
</Modal>
<Modal
title={
<div
Expand Down

0 comments on commit 51ffda1

Please sign in to comment.