docs: optimize modal docs (#25724)

* docs: optimize modal docs

* docs: remove <br />
This commit is contained in:
Amour1688 2020-07-21 12:26:56 +08:00 committed by GitHub
parent da25fd1b38
commit 453f7d13f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 26 deletions

View File

@ -241,24 +241,34 @@ exports[`renders ./components/modal/demo/info.md correctly 1`] = `
`;
exports[`renders ./components/modal/demo/locale.md correctly 1`] = `
<div>
<button
class="ant-btn ant-btn-primary"
type="button"
<div
class="ant-space ant-space-horizontal ant-space-align-center"
>
<div
class="ant-space-item"
style="margin-right:8px"
>
<span>
Modal
</span>
</button>
<br />
<button
class="ant-btn"
type="button"
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Modal
</span>
</button>
</div>
<div
class="ant-space-item"
>
<span>
Confirm
</span>
</button>
<button
class="ant-btn"
type="button"
>
<span>
Confirm
</span>
</button>
</div>
</div>
`;

View File

@ -62,9 +62,3 @@ class App extends React.Component {
ReactDOM.render(<App />, mountNode);
```
<style>
.ant-modal p {
margin: 0;
}
</style>

View File

@ -14,7 +14,7 @@ title:
To customize the text of the buttons, you need to set `okText` and `cancelText` props.
```jsx
import { Modal, Button } from 'antd';
import { Modal, Button, Space } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
class LocalizedModal extends React.Component {
@ -66,11 +66,10 @@ function confirm() {
}
ReactDOM.render(
<div>
<Space>
<LocalizedModal />
<br />
<Button onClick={confirm}>Confirm</Button>
</div>,
</Space>,
mountNode,
);
```