@@ -35,19 +35,19 @@ const notificationConfig: Record<
3535> = {
3636 info : {
3737 color : 'blue' ,
38- icon : < IconInfoCircle size = { 20 } /> ,
38+ icon : < IconInfoCircle size = { 16 } /> ,
3939 } ,
4040 warning : {
4141 color : 'yellow' ,
42- icon : < IconAlertTriangle size = { 20 } /> ,
42+ icon : < IconAlertTriangle size = { 16 } /> ,
4343 } ,
4444 error : {
4545 color : 'red' ,
46- icon : < IconX size = { 20 } /> ,
46+ icon : < IconX size = { 16 } /> ,
4747 } ,
4848 success : {
4949 color : 'green' ,
50- icon : < IconCircleCheck size = { 20 } /> ,
50+ icon : < IconCircleCheck size = { 16 } /> ,
5151 } ,
5252} ;
5353
@@ -69,56 +69,44 @@ const SystemNotificationBanner = ({
6969 const config = notificationConfig [ notification . type ] ;
7070
7171 return (
72- < Alert
72+ < Box
7373 key = { notification . id }
74- variant = "filled"
75- color = { config . color }
76- radius = { 0 }
77- icon = { config . icon }
78- title = { notification . title }
79- withCloseButton = { notification . dismissible !== false }
80- onClose = { ( ) => dismissNotification ( notification . id ) }
81- styles = { {
82- root : {
83- borderRadius : 0 ,
84- } ,
85- message : {
86- color : 'inherit' ,
87- } ,
88- } }
74+ bg = { `var(--mantine-color-${ config . color } -filled)` }
75+ c = "white"
76+ py = "xs"
77+ px = "md"
8978 >
90- < Group justify = "space-between" align = "center" wrap = "nowrap" >
91- < Text size = "sm" inherit >
92- { notification . message }
93- </ Text >
94- { notification . action && (
95- < Box >
96- { notification . action . href ? (
97- < Anchor
98- href = { notification . action . href }
99- target = "_blank"
100- rel = "noopener noreferrer"
101- c = "white"
102- fw = { 600 }
103- size = "sm"
104- underline = "always"
105- >
106- { notification . action . label }
107- </ Anchor >
108- ) : (
109- < Button
110- variant = "white"
111- color = { config . color }
112- size = "compact-sm"
113- onClick = { notification . action . onClick }
114- >
115- { notification . action . label }
116- </ Button >
117- ) }
118- </ Box >
79+ < Group justify = "space-between" align = "center" wrap = "nowrap" gap = "md" >
80+ < Group gap = "xs" wrap = "nowrap" style = { { flex : 1 , minWidth : 0 } } >
81+ { config . icon }
82+ < Text size = "sm" truncate >
83+ { notification . message }
84+ </ Text >
85+ { notification . action ?. href && (
86+ < Anchor
87+ href = { notification . action . href }
88+ target = "_blank"
89+ rel = "noopener noreferrer"
90+ c = "white"
91+ fw = { 600 }
92+ size = "sm"
93+ underline = "always"
94+ style = { { flexShrink : 0 } }
95+ >
96+ { notification . action . label }
97+ </ Anchor >
98+ ) }
99+ </ Group >
100+ { notification . dismissible !== false && (
101+ < CloseButton
102+ size = "sm"
103+ c = "white"
104+ onClick = { ( ) => dismissNotification ( notification . id ) }
105+ aria-label = "Dismiss notification"
106+ />
119107 ) }
120108 </ Group >
121- </ Alert >
109+ </ Box >
122110 ) ;
123111 } ) }
124112 </ Stack >
0 commit comments