From b16aeb60e1d026fc8213298bf5e63d10dfcec5f2 Mon Sep 17 00:00:00 2001 From: Emil Kowalski <36730035+emilkowalski@users.noreply.github.com> Date: Sat, 3 Feb 2024 12:39:53 +0100 Subject: [PATCH] Allow to style all unstyled toasts with the default prop (#324) --- src/index.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 74fa7743..c4e73ad4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -235,6 +235,7 @@ const Toast = (props: ToastProps) => { toastClassname, classNames?.toast, toast?.classNames?.toast, + classNames?.default, classNames?.[toastType], toast?.classNames?.[toastType], )} @@ -459,10 +460,10 @@ const Toaster = (props: ToasterProps) => { theme !== 'system' ? theme : typeof window !== 'undefined' - ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches - ? 'dark' - : 'light' - : 'light', + ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches + ? 'dark' + : 'light' + : 'light', ); const listRef = React.useRef(null); @@ -658,8 +659,8 @@ const Toaster = (props: ToasterProps) => { cancelButtonStyle={toastOptions?.cancelButtonStyle} actionButtonStyle={toastOptions?.actionButtonStyle} removeToast={removeToast} - toasts={toasts.filter(t => t.position == toast.position)} - heights={heights.filter(h => h.position == toast.position)} + toasts={toasts.filter((t) => t.position == toast.position)} + heights={heights.filter((h) => h.position == toast.position)} setHeights={setHeights} expandByDefault={expand} gap={gap}