diff --git a/app/layout.tsx b/app/layout.tsx index 3c84875..b320ea4 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,6 +4,7 @@ import { Geist, Geist_Mono } from "next/font/google"; import { Analytics } from "@vercel/analytics/next"; import { Toaster } from "sonner"; import ClientWalletProvider from "@/components/ClientWalletProvider"; +import { Toaster } from "@/components/ui/sonner"; import "./globals.css"; const geistSans = Geist({ @@ -44,6 +45,7 @@ export default function RootLayout({ + ); diff --git a/components/ui/sonner.tsx b/components/ui/sonner.tsx new file mode 100644 index 0000000..b295710 --- /dev/null +++ b/components/ui/sonner.tsx @@ -0,0 +1,45 @@ +"use client"; + +import { + CircleCheckIcon, + InfoIcon, + Loader2Icon, + OctagonXIcon, + TriangleAlertIcon, +} from "lucide-react"; +import { useTheme } from "next-themes"; +import { Toaster as Sonner, type ToasterProps } from "sonner"; + +const Toaster = ({ ...props }: ToasterProps) => { + const { theme = "system" } = useTheme(); + + return ( + , + info: , + warning: , + error: , + loading: , + }} + style={ + { + "--normal-bg": "var(--popover)", + "--normal-text": "var(--popover-foreground)", + "--normal-border": "var(--border)", + "--border-radius": "var(--radius)", + } as React.CSSProperties + } + toastOptions={{ + classNames: { + toast: "cn-toast", + }, + }} + {...props} + /> + ); +}; + +export { Toaster }; diff --git a/package-lock.json b/package-lock.json index 5efaf0f..0a7b8bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18130,4 +18130,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 8adf770..f4a3868 100644 --- a/package.json +++ b/package.json @@ -81,4 +81,4 @@ "tw-animate-css": "1.3.3", "typescript": "^5" } -} +} \ No newline at end of file