mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
860fd57276
* feat(notification): add show progress option and update docs * feat(notification): update style for progress * fix: lint issues and add version for the doc * feat: upgrade rc-notification and update the style changes * test: update test snapshots * fix: update changes base on the conversation * fix: update bg base on the conversation * fix: use primary color for progress bg * docs: update doc changes Co-authored-by: kiner-tang <1127031143@qq.com> Signed-off-by: Eden Wang <yociduo@vip.qq.com> --------- Signed-off-by: Eden Wang <yociduo@vip.qq.com> Co-authored-by: kiner-tang <1127031143@qq.com>
27 lines
631 B
TypeScript
27 lines
631 B
TypeScript
import React from 'react';
|
|
import { Button, notification } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [api, contextHolder] = notification.useNotification();
|
|
|
|
const openNotification = () => {
|
|
api.open({
|
|
message: 'Notification Title',
|
|
description:
|
|
'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
|
|
showProgress: true,
|
|
});
|
|
};
|
|
|
|
return (
|
|
<>
|
|
{contextHolder}
|
|
<Button type="primary" onClick={openNotification}>
|
|
Open the notification box
|
|
</Button>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|