Add notification context and privacy toggle for analytics

Introduces a NotificationProvider context to centralize notification logic and state, refactoring UnifiedNotifications to use this context. Adds a privacy toggle to AnalyticsDashboard and RevenueChart to allow hiding sensitive numbers. Updates layout to wrap the app with NotificationProvider.
This commit is contained in:
NotII
2025-07-28 22:50:55 +02:00
parent 2452a3c5f6
commit 48cfd45fb1
6 changed files with 460 additions and 287 deletions

View File

@@ -4,6 +4,7 @@ import { ThemeProvider } from "@/components/layout/theme-provider"
import { Toaster } from "sonner"
import type React from "react"
import KeepOnline from "@/components/KeepOnline"
import { NotificationProvider } from "@/lib/notification-context"
import { Metadata, Viewport } from "next"
const inter = Inter({ subsets: ["latin"] })
@@ -70,13 +71,15 @@ export default function RootLayout({
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem disableTransitionOnChange>
<Toaster
theme="dark"
richColors
position="top-right"
/>
<KeepOnline />
{children}
<NotificationProvider>
<Toaster
theme="dark"
richColors
position="top-right"
/>
<KeepOnline />
{children}
</NotificationProvider>
</ThemeProvider>
</body>
</html>