1+ import { cn } from '@venusprotocol/ui' ;
12import { AnimatePresence , motion } from 'motion/react' ;
23import { createPortal } from 'react-dom' ;
34
@@ -18,14 +19,19 @@ const NotificationCenter: React.FC = () => {
1819 data-testid = { TEST_IDS . container }
1920 >
2021 < AnimatePresence mode = "popLayout" initial = { false } >
21- { notifications . map ( ( { id, ...otherNotificationProps } ) => (
22+ { notifications . map ( ( { id, variant = 'info' , ...otherNotificationProps } ) => (
2223 < motion . li
2324 key = { id }
24- className = "mb-2 last:mb-0"
25+ className = { cn (
26+ 'mb-2 last:mb-0 rounded-lg border backdrop-blur-lg overflow-hidden' ,
27+ ( variant === 'info' || variant === 'loading' ) && 'bg-blue/10 border-lightGrey' ,
28+ variant === 'error' && 'bg-red/10 border-red' ,
29+ variant === 'success' && 'bg-green/10 border-green' ,
30+ variant === 'warning' && 'bg-orange/10 border-orange' ,
31+ ) }
2532 layout
26- initial = { { opacity : 0 , x : '100 %' } }
33+ initial = { { x : '110 %' } }
2734 animate = { {
28- opacity : 1 ,
2935 x : 0 ,
3036 transition : {
3137 x : {
@@ -36,7 +42,6 @@ const NotificationCenter: React.FC = () => {
3642 opacity : {
3743 ease : EASE ,
3844 duration : ANIMATION_BASE_DURATION_S ,
39- delay : ( ANIMATION_BASE_DURATION_S * 1 ) / 3 ,
4045 } ,
4146 } ,
4247 } }
@@ -49,7 +54,11 @@ const NotificationCenter: React.FC = () => {
4954 duration : ANIMATION_BASE_DURATION_S ,
5055 } }
5156 >
52- < Notice { ...otherNotificationProps } />
57+ < Notice
58+ variant = { variant }
59+ className = "bg-transparent border-transparent backdrop-blur-none rounded-none"
60+ { ...otherNotificationProps }
61+ />
5362 </ motion . li >
5463 ) ) }
5564 </ AnimatePresence >
0 commit comments