Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notification): add show progress option and update docs
- Loading branch information
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## zh-CN | ||
|
||
显示自动关闭通知框的进度条。 | ||
|
||
## en-US | ||
|
||
Show progress bar for auto-closing notification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters