diff --git a/packages/toast/src/Toast.tsx b/packages/toast/src/Toast.tsx index 8a7e8b0e4..7852b4435 100644 --- a/packages/toast/src/Toast.tsx +++ b/packages/toast/src/Toast.tsx @@ -1,5 +1,5 @@ import type { Toast as ToastPropType } from './types' -import { CheckCircleFilledIcon, ClearCircleFilledIcon } from '@standardnotes/icons' +import { CheckCircleFilledIcon, ClearCircleFilledIcon, InfoIcon } from '@standardnotes/icons' import { dismissToast } from './toastStore' import { ToastType } from './enums' import { ForwardedRef, forwardRef, RefObject, useEffect } from 'react' @@ -30,7 +30,7 @@ const iconForToastType = (type: ToastType) => { case ToastType.Loading: return
default: - return null + return } } @@ -90,15 +90,12 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef -
+
{icon ?
{icon}
: null} -
{toast.message}
+ {toast.title &&
{toast.title}
} +
{toast.message}
{hasActions && ( - <> +
{toast.actions?.map((action, index) => (
)}
{hasProgress && ( diff --git a/packages/toast/src/types.ts b/packages/toast/src/types.ts index 4eab143c3..da159f7be 100644 --- a/packages/toast/src/types.ts +++ b/packages/toast/src/types.ts @@ -7,6 +7,7 @@ export type ToastAction = { type CommonToastProperties = { type: ToastType + title?: string message: string actions?: ToastAction[] progress?: number