diff --git a/bun.lock b/bun.lock index 3d12f7c..0ea3a8b 100644 --- a/bun.lock +++ b/bun.lock @@ -16,11 +16,13 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.525.0", + "next-themes": "^0.4.6", "react": "^19.1.0", "react-dom": "^19.1.0", "react-router": "^7.6.3", "sidebar": "^1.0.2", "socket.io-client": "^4.8.1", + "sonner": "^2.0.6", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.11", }, @@ -591,6 +593,8 @@ "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], + "next-themes": ["next-themes@0.4.6", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA=="], + "node-releases": ["node-releases@2.0.19", "", {}, "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw=="], "number-flow": ["number-flow@0.5.8", "", { "dependencies": { "esm-env": "^1.1.4" } }, "sha512-FPr1DumWyGi5Nucoug14bC6xEz70A1TnhgSHhKyfqjgji2SOTz+iLJxKtv37N5JyJbteGYCm6NQ9p1O4KZ7iiA=="], @@ -659,6 +663,8 @@ "socket.io-parser": ["socket.io-parser@4.2.4", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" } }, "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew=="], + "sonner": ["sonner@2.0.6", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-yHFhk8T/DK3YxjFQXIrcHT1rGEeTLliVzWbO0xN8GberVun2RiBnxAjXAYpZrqwEVHBG9asI/Li8TAAhN9m59Q=="], + "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], "strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], diff --git a/package.json b/package.json index 455c9fd..77e4f4a 100644 --- a/package.json +++ b/package.json @@ -22,11 +22,13 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.525.0", + "next-themes": "^0.4.6", "react": "^19.1.0", "react-dom": "^19.1.0", "react-router": "^7.6.3", "sidebar": "^1.0.2", "socket.io-client": "^4.8.1", + "sonner": "^2.0.6", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.11" }, diff --git a/src/App.tsx b/src/App.tsx index 558620d..0c45519 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,17 +6,19 @@ import { SocketProvider } from '@/contexts/SocketContext' import { AccountPage } from '@/pages/AccountPage' import { ActivityPage } from '@/pages/ActivityPage' import { AdminUsersPage } from '@/pages/AdminUsersPage' -import AdminSoundsPage from '@/pages/AdminSoundsPage' +import { AdminSoundsPage } from '@/pages/AdminSoundsPage' import { DashboardPage } from '@/pages/DashboardPage' import { LoginPage } from '@/pages/LoginPage' import { RegisterPage } from '@/pages/RegisterPage' -import SoundboardPage from '@/pages/SoundboardPage' +import { SoundboardPage } from '@/pages/SoundboardPage' import { Navigate, Route, BrowserRouter as Router, Routes } from 'react-router' import { ThemeProvider } from './components/ThemeProvider' +import { Toaster } from 'sonner' function App() { return ( + diff --git a/src/components/ui/sonner.tsx b/src/components/ui/sonner.tsx new file mode 100644 index 0000000..cd62aff --- /dev/null +++ b/src/components/ui/sonner.tsx @@ -0,0 +1,23 @@ +import { useTheme } from "next-themes" +import { Toaster as Sonner, ToasterProps } from "sonner" + +const Toaster = ({ ...props }: ToasterProps) => { + const { theme = "system" } = useTheme() + + return ( + + ) +} + +export { Toaster } diff --git a/src/pages/AdminSoundsPage.tsx b/src/pages/AdminSoundsPage.tsx index dbde6c2..9ab7d12 100644 --- a/src/pages/AdminSoundsPage.tsx +++ b/src/pages/AdminSoundsPage.tsx @@ -46,7 +46,7 @@ interface NormalizationStats { size_difference: number; } -export default function AdminSoundsPage() { +export function AdminSoundsPage() { const [sounds, setSounds] = useState([]); const [scanStats, setScanStats] = useState(null); const [normalizationStats, setNormalizationStats] = useState(null); diff --git a/src/pages/SoundboardPage.tsx b/src/pages/SoundboardPage.tsx index 708d6ca..cd003b9 100644 --- a/src/pages/SoundboardPage.tsx +++ b/src/pages/SoundboardPage.tsx @@ -68,7 +68,7 @@ const SoundCard: React.FC = ({ sound, onPlay, isPlaying }) => { ); }; -export default function SoundboardPage() { +export function SoundboardPage() { const [sounds, setSounds] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null);