notification
notification copied to clipboard
Add closeTypes('manual', 'auto') for onClose to distinguish between manual-close by click and auto-close by duration timer.
Add closeTypes('manual', 'auto') for onClose to distinguish between manual-close by click and auto-close by duration timer.
为onClose时间增加关闭类型:“手动关闭”和“自动关闭”,用于区分通过duration timer的关闭和通过用户click的关闭。
notification.open({
...
onClose: (closeType) => {
console.log(closeType) // "auto", "manual"
},
})
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/react-component/notification/FQXLYQaf6rpN9AW9yYaFkAHE63qU
✅ Preview: https://notification-git-fork-frankkai-master-react-component.vercel.app
Codecov Report
Merging #168 (4d919b9) into master (af67623) will increase coverage by
0.03%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #168 +/- ##
==========================================
+ Coverage 98.75% 98.78% +0.03%
==========================================
Files 3 3
Lines 160 165 +5
Branches 31 31
==========================================
+ Hits 158 163 +5
Misses 2 2
Impacted Files | Coverage Δ | |
---|---|---|
src/Notice.tsx | 98.03% <100.00%> (+0.21%) |
:arrow_up: |
src/Notification.tsx | 98.94% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update af67623...4d919b9. Read the comment docs.