An opinionated toast component for React.
Allow to hide icons by passing null (#610)
Emil Kowalski728e87ccbb8f
diff --git a/src/index.tsx b/src/index.tsxindex 8d79b92..6954f51 100644--- a/src/index.tsx+++ b/src/index.tsx@@ -254,6 +254,8 @@ const Toast = (props: ToastProps) => {return <Loader className={cn(classNames?.loader, toast?.classNames?.loader)} visible={toastType === 'loading'} />;}+ const icon = toast.icon || icons?.[toastType] || getAsset(toastType);+return (<litabIndex={0}@@ -429,10 +431,12 @@ const Toast = (props: ToastProps) => {</button>) : null}{/* TODO: This can be cleaner */}- {toastType || toast.icon || toast.promise ? (+ {(toastType || toast.icon || toast.promise) &&+ toast.icon !== null &&+ (icons?.[toastType] !== null || toast.icon) ? (<div data-icon="" className={cn(classNames?.icon, toast?.classNames?.icon)}>{toast.promise || (toast.type === 'loading' && !toast.icon) ? toast.icon || getLoadingIcon() : null}- {toast.type !== 'loading' ? toast.icon || icons?.[toastType] || getAsset(toastType) : null}+ {toast.type !== 'loading' ? icon : null}</div>) : null}