11import type { Toast as ToastPropType } from './types'
2- import { CheckCircleFilledIcon , ClearCircleFilledIcon } from '@standardnotes/icons'
2+ import { CheckCircleFilledIcon , ClearCircleFilledIcon , InfoIcon } from '@standardnotes/icons'
33import { dismissToast } from './toastStore'
44import { ToastType } from './enums'
55import { ForwardedRef , forwardRef , RefObject , useEffect } from 'react'
@@ -30,7 +30,7 @@ const iconForToastType = (type: ToastType) => {
3030 case ToastType . Loading :
3131 return < div className = "border-info h-4 w-4 animate-spin rounded-full border border-solid border-r-transparent" />
3232 default :
33- return null
33+ return < InfoIcon className = "fill-text h-5 w-5" />
3434 }
3535}
3636
@@ -90,15 +90,12 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
9090 } }
9191 ref = { ref }
9292 >
93- < div
94- className = { `flex w-full flex-wrap items-center gap-2 ${
95- hasActions ? 'p-2 pl-3' : hasProgress ? 'px-3 py-2.5' : 'p-3'
96- } `}
97- >
93+ < div className = "grid gap-x-2.5 gap-y-1 overflow-hidden grid-cols-[1fr,auto] pl-3 pr-3.5 py-2.5" >
9894 { icon ? < div className = "sn-icon flex flex-shrink-0 items-center justify-center" > { icon } </ div > : null }
99- < div className = "text-text text-sm [word-wrap:anywhere]" > { toast . message } </ div >
95+ { toast . title && < div className = "text-text text-sm font-semibold col-start-2" > { toast . title } </ div > }
96+ < div className = "text-text text-sm [word-wrap:anywhere] col-start-2" > { toast . message } </ div >
10097 { hasActions && (
101- < >
98+ < div className = "col-start-2 -mx-1.5 -mb-0.5" >
10299 { toast . actions ?. map ( ( action , index ) => (
103100 < button
104101 className = { `hover:bg-passive-3 cursor-pointer rounded border-0 px-[0.45rem] py-1 text-sm font-semibold md:bg-transparent ${ colorForToastType (
@@ -114,7 +111,7 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
114111 { action . label }
115112 </ button >
116113 ) ) }
117- </ >
114+ </ div >
118115 ) }
119116 </ div >
120117 { hasProgress && (
0 commit comments