-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2578 from XiaoMi/feature/notification(add-size-api)
feat(notification): add size api
- Loading branch information
Showing
6 changed files
with
119 additions
and
16 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,5 @@ | ||
--- | ||
"@hi-ui/notification": minor | ||
--- | ||
|
||
feat: 增加 size API |
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,5 @@ | ||
--- | ||
"@hi-ui/hiui": patch | ||
--- | ||
|
||
Notification feat: 增加 size API |
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
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,29 @@ | ||
import React from 'react' | ||
import notification from '../src' | ||
import Button from '@hi-ui/button' | ||
|
||
/** | ||
* @title 设置尺寸 | ||
*/ | ||
export const Size = () => { | ||
const notificationIdRef = React.useRef<React.ReactText>() | ||
|
||
const openNotification = (size) => { | ||
notificationIdRef.current = notification.open({ | ||
size, | ||
autoClose: false, | ||
title: '数据备份通知', | ||
content: '将于 2035.08.10 00:00:00-08:00:00 期间进行系统服务器升级维护!', | ||
}) | ||
} | ||
return ( | ||
<> | ||
<h1>Size</h1> | ||
<div className="notification-size__wrap"> | ||
<Button onClick={() => openNotification('lg')}>Notice lg</Button> | ||
<Button onClick={() => openNotification('md')}>Notice md</Button> | ||
<Button onClick={() => openNotification('sm')}>Notice sm</Button> | ||
</div> | ||
</> | ||
) | ||
} |