Openstatus www.openstatus.dev

fix: sonner (#841)

authored by

Maximilian Kaske and committed by
GitHub
9a16cc8d 0dcd5820

+32 -1
+1 -1
apps/web/src/app/layout.tsx
··· 5 5 import LocalFont from "next/font/local"; 6 6 7 7 import { OpenStatusProvider } from "@openstatus/next-monitoring"; 8 - import { Toaster } from "@openstatus/ui"; 8 + import { Toaster } from "@/components/ui/sonner"; 9 9 10 10 import { 11 11 defaultMetadata,
+31
apps/web/src/components/ui/sonner.tsx
··· 1 + "use client"; 2 + 3 + import { useTheme } from "next-themes"; 4 + import { Toaster as Sonner } from "sonner"; 5 + 6 + type ToasterProps = React.ComponentProps<typeof Sonner>; 7 + 8 + const Toaster = ({ ...props }: ToasterProps) => { 9 + const { theme = "system" } = useTheme(); 10 + 11 + return ( 12 + <Sonner 13 + theme={theme as ToasterProps["theme"]} 14 + className="toaster group" 15 + toastOptions={{ 16 + classNames: { 17 + toast: 18 + "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg", 19 + description: "group-[.toast]:text-muted-foreground", 20 + actionButton: 21 + "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground", 22 + cancelButton: 23 + "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground", 24 + }, 25 + }} 26 + {...props} 27 + /> 28 + ); 29 + }; 30 + 31 + export { Toaster };