1
+ /* eslint-disable indent */
1
2
import { Transition , Toast , Alert } from 'solid-headless'
2
3
import { AiOutlineCheckCircle } from 'solid-icons/ai'
3
4
import { FiAlertTriangle , FiAlertOctagon } from 'solid-icons/fi'
4
5
import { IoAlertCircleSharp } from 'solid-icons/io'
5
6
import { createSignal , Component } from 'solid-js'
6
7
import CloseIcon from '@components/CloseIcon'
7
8
import { ENotificationType } from '@static/types/enums'
8
- import { notifications } from '@store/ui/selectors'
9
+ import { notifications , notificationsType } from '@store/ui/selectors'
9
10
10
11
interface ToastProps {
11
12
id : string
12
13
message : string
13
14
}
14
15
15
- const NotificationIcon = ( notificationAction : ENotificationType ) => {
16
- switch ( notificationAction ) {
17
- case ENotificationType . SUCCESS :
18
- return < AiOutlineCheckCircle size = { 25 } color = "#68D391" />
19
- case ENotificationType . ERROR :
20
- return < FiAlertOctagon size = { 25 } color = "#F56565" />
21
- case ENotificationType . WARNING :
22
- return < FiAlertTriangle size = { 25 } color = "#F6E05E" />
23
- case ENotificationType . INFO :
24
- return < IoAlertCircleSharp size = { 25 } color = "#90CDF4" />
16
+ const NotificationIcon = ( ) => {
17
+ switch ( notificationsType ( ) ) {
18
+ case ENotificationType . SUCCESS :
19
+ return < AiOutlineCheckCircle size = { 25 } color = "#68D391" />
20
+ case ENotificationType . ERROR :
21
+ return < FiAlertOctagon size = { 25 } color = "#F56565" />
22
+ case ENotificationType . WARNING :
23
+ return < FiAlertTriangle size = { 25 } color = "#F6E05E" />
24
+ case ENotificationType . INFO :
25
+ return < IoAlertCircleSharp size = { 25 } color = "#90CDF4" />
25
26
}
26
27
}
27
28
@@ -47,7 +48,7 @@ const CustomToast: Component<ToastProps> = (props) => {
47
48
} } >
48
49
< Toast class = "flex justify-between items-center" >
49
50
< Alert class = "bg-slate-600 flex grow flex-row items-center justify-center text-xl text-bold text-gray-50 p-4" >
50
- { /* { NotificationIcon()} */ }
51
+ { NotificationIcon ( ) }
51
52
< span class = "flex-1 text-sm font-semibold pl-1 pr-1 text-gray-50" >
52
53
{ props . message }
53
54
</ span >
0 commit comments