Skip to content

Commit

Permalink
Allow to style all unstyled toasts with the default prop (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Feb 3, 2024
1 parent 5de89d5 commit b16aeb6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ const Toast = (props: ToastProps) => {
toastClassname,
classNames?.toast,
toast?.classNames?.toast,
classNames?.default,
classNames?.[toastType],
toast?.classNames?.[toastType],
)}
Expand Down Expand Up @@ -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<HTMLOListElement>(null);
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit b16aeb6

Please sign in to comment.