mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-25 08:33:00 +08:00
8f81298027
* docs: Adjust modal demo * test: update snapshot
47 lines
958 B
TypeScript
47 lines
958 B
TypeScript
import React from 'react';
|
|
import { Button, Modal, Space } from 'antd';
|
|
|
|
const info = () => {
|
|
Modal.info({
|
|
title: 'This is a notification message',
|
|
content: (
|
|
<div>
|
|
<p>some messages...some messages...</p>
|
|
<p>some messages...some messages...</p>
|
|
</div>
|
|
),
|
|
onOk() {},
|
|
});
|
|
};
|
|
|
|
const success = () => {
|
|
Modal.success({
|
|
content: 'some messages...some messages...',
|
|
});
|
|
};
|
|
|
|
const error = () => {
|
|
Modal.error({
|
|
title: 'This is an error message',
|
|
content: 'some messages...some messages...',
|
|
});
|
|
};
|
|
|
|
const warning = () => {
|
|
Modal.warning({
|
|
title: 'This is a warning message',
|
|
content: 'some messages...some messages...',
|
|
});
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Space wrap>
|
|
<Button onClick={info}>Info</Button>
|
|
<Button onClick={success}>Success</Button>
|
|
<Button onClick={error}>Error</Button>
|
|
<Button onClick={warning}>Warning</Button>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|