File tree Expand file tree Collapse file tree 2 files changed +1
-70
lines changed
packages/ui-components/src
Providers/NotificationProvider Expand file tree Collapse file tree 2 files changed +1
-70
lines changed Original file line number Diff line number Diff line change 13
13
dark:bg-neutral-900;
14
14
}
15
15
16
- .root [data-state = 'open' ] {
17
- animation : slide-in 300ms cubic-bezier (0.16 , 1 , 0.3 , 1 );
18
- }
19
-
20
- .root [data-state = 'closed' ] {
21
- animation : slide-out 200ms ease-in forwards;
22
- }
23
-
24
- .root [data-swipe = 'move' ] {
25
- transform : translateX (var (--radix-toast-swipe-move-x ));
26
- }
27
-
28
- .root [data-swipe = 'cancel' ] {
29
- transform : translateX (0 );
30
- transition : transform 200ms ease-out;
31
- }
32
-
33
- .root [data-swipe = 'end' ] {
34
- animation : swipe-out 150ms ease-out forwards;
35
- }
36
-
37
16
.message {
38
17
@apply font-medium
39
18
text-green-600
40
19
dark:text-white;
41
20
}
42
-
43
- @keyframes slide-in {
44
- from {
45
- opacity : 0 ;
46
- transform : translateX (calc (100% + 24px ));
47
- }
48
-
49
- to {
50
- opacity : 1 ;
51
- transform : translateX (0 );
52
- }
53
- }
54
-
55
- @keyframes slide-out {
56
- from {
57
- opacity : 1 ;
58
- transform : translateX (0 );
59
- }
60
-
61
- to {
62
- opacity : 0 ;
63
- transform : translateX (calc (100% + 24px ));
64
- }
65
- }
66
-
67
- @keyframes swipe-out {
68
- from {
69
- transform : translateX (var (--radix-toast-swipe-end-x ));
70
- }
71
-
72
- to {
73
- opacity : 0 ;
74
- transform : translateX (calc (100% + 24px ));
75
- }
76
- }
Original file line number Diff line number Diff line change @@ -39,26 +39,13 @@ export const NotificationProvider: FC<PropsWithChildren> = ({ children }) => {
39
39
}
40
40
} , [ notification ] ) ;
41
41
42
- const handleOpenChange = ( open : boolean ) => {
43
- setIsOpen ( open ) ;
44
- if ( ! open ) {
45
- setTimeout ( ( ) => {
46
- dispatch ( null ) ;
47
- } , 200 ) ; // Match your exit animation duration
48
- }
49
- } ;
50
-
51
42
return (
52
43
< NotificationContext . Provider value = { notification } >
53
44
< NotificationDispatch . Provider value = { dispatch } >
54
45
< Toast . Provider swipeDirection = "right" >
55
46
{ children }
56
47
{ notification && (
57
- < Notification
58
- open = { isOpen }
59
- duration = { notification . duration }
60
- onChange = { handleOpenChange }
61
- >
48
+ < Notification open = { isOpen } duration = { notification . duration } >
62
49
{ notification . message }
63
50
</ Notification >
64
51
) }
You can’t perform that action at this time.
0 commit comments