Files
MikrotikManager/components/ui/sonner.tsx
T
Denozordec 40e2040fb0
Docker images / backend-image (push) Successful in 2m35s
Docker images / frontend-image (push) Successful in 2m9s
Docker images / updater-image (push) Successful in 38s
Docker images / notify-webhook (push) Has been skipped
feat: refactor theme management and remove next-themes dependency
- Replaced the next-themes package with a custom ThemeProvider component for enhanced theme management.
- Implemented local storage handling for theme persistence and system theme detection.
- Updated the Toaster component to utilize the new theme context.
- Removed unused next-themes references from package.json and package-lock.json.
2026-05-12 16:07:40 +07:00

28 lines
871 B
TypeScript

"use client"
import { useTheme } from "@/components/theme-provider"
import { Toaster as Sonner, type ToasterProps } from "sonner"
const Toaster = ({ ...props }: ToasterProps) => {
const { resolvedTheme } = useTheme()
return (
<Sonner
theme={(resolvedTheme as ToasterProps["theme"]) ?? "system"}
className="toaster group"
richColors
toastOptions={{
classNames: {
toast: "group toast group-[.toaster]:border-border group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:shadow-lg",
description: "group-[.toast]:text-muted-foreground",
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
},
}}
{...props}
/>
)
}
export { Toaster }