feat(SW-556): add surprise notification component
This commit is contained in:
@@ -49,7 +49,7 @@ export function Toast({ message, onClose, variant }: ToastsProps) {
|
||||
}
|
||||
|
||||
export const toast = {
|
||||
success: (message: string, options?: ExternalToast) =>
|
||||
success: (message: React.ReactNode, options?: ExternalToast) =>
|
||||
sonnerToast.custom(
|
||||
(t) => (
|
||||
<Toast
|
||||
@@ -60,7 +60,7 @@ export const toast = {
|
||||
),
|
||||
options
|
||||
),
|
||||
info: (message: string, options?: ExternalToast) =>
|
||||
info: (message: React.ReactNode, options?: ExternalToast) =>
|
||||
sonnerToast.custom(
|
||||
(t) => (
|
||||
<Toast
|
||||
@@ -71,7 +71,7 @@ export const toast = {
|
||||
),
|
||||
options
|
||||
),
|
||||
error: (message: string, options?: ExternalToast) =>
|
||||
error: (message: React.ReactNode, options?: ExternalToast) =>
|
||||
sonnerToast.custom(
|
||||
(t) => (
|
||||
<Toast
|
||||
@@ -82,7 +82,7 @@ export const toast = {
|
||||
),
|
||||
options
|
||||
),
|
||||
warning: (message: string, options?: ExternalToast) =>
|
||||
warning: (message: React.ReactNode, options?: ExternalToast) =>
|
||||
sonnerToast.custom(
|
||||
(t) => (
|
||||
<Toast
|
||||
|
||||
@@ -5,6 +5,6 @@ import type { VariantProps } from "class-variance-authority"
|
||||
export interface ToastsProps
|
||||
extends Omit<React.AnchorHTMLAttributes<HTMLDivElement>, "color">,
|
||||
VariantProps<typeof toastVariants> {
|
||||
message: string
|
||||
message: React.ReactNode
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user