Add Sonner-based notifications and UX polish

This commit is contained in:
MOH
2026-03-10 17:43:26 +01:00
parent eceb0f3a54
commit 77cc9dca87
32 changed files with 279 additions and 310 deletions
+6
View File
@@ -3,6 +3,7 @@
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { useSound } from "@/components/sound-provider";
import { Button, type ButtonProps } from "@/components/ui/button";
@@ -11,6 +12,8 @@ import { cn } from "@/lib/utils";
type ThemeToggleProps = {
ariaLabel?: string;
label?: string;
lightToastLabel?: string;
darkToastLabel?: string;
variant?: ButtonProps["variant"];
className?: string;
iconClassName?: string;
@@ -19,6 +22,8 @@ type ThemeToggleProps = {
export function ThemeToggle({
ariaLabel = "Toggle theme",
label,
lightToastLabel = "Light mode enabled",
darkToastLabel = "Dark mode enabled",
variant = "outline",
className,
iconClassName,
@@ -54,6 +59,7 @@ export function ThemeToggle({
setTheme(nextTheme);
playSound(nextTheme === "dark" ? "/audio/dark.mp3" : "/audio/light.mp3");
toast(nextTheme === "dark" ? darkToastLabel : lightToastLabel);
};
return (