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 1313 dark:bg-neutral-900;
1414}
1515
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-
3716.message {
3817 @apply font-medium
3918 text-green-600
4019 dark:text-white;
4120}
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 }) => {
3939 }
4040 } , [ notification ] ) ;
4141
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-
5142 return (
5243 < NotificationContext . Provider value = { notification } >
5344 < NotificationDispatch . Provider value = { dispatch } >
5445 < Toast . Provider swipeDirection = "right" >
5546 { children }
5647 { notification && (
57- < Notification
58- open = { isOpen }
59- duration = { notification . duration }
60- onChange = { handleOpenChange }
61- >
48+ < Notification open = { isOpen } duration = { notification . duration } >
6249 { notification . message }
6350 </ Notification >
6451 ) }
You can’t perform that action at this time.
0 commit comments