fix: dashboard updates when switching sites
- Added SiteContext for global site selection state - Updated admin layout with SiteProvider - Updated SiteSwitcher to use shared context - Dashboard now refetches data when site changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { AuthProvider } from '@/components/providers/auth-provider';
|
||||
import { SiteProvider } from '@/contexts/site-context';
|
||||
import { Sidebar } from '@/components/layout/sidebar';
|
||||
import { Header } from '@/components/layout/header';
|
||||
|
||||
@@ -9,13 +10,15 @@ export default function AdminLayout({
|
||||
}) {
|
||||
return (
|
||||
<AuthProvider>
|
||||
<div className="min-h-screen bg-primary-50">
|
||||
<Sidebar />
|
||||
<div className="pl-64">
|
||||
<Header />
|
||||
<main className="p-6">{children}</main>
|
||||
<SiteProvider>
|
||||
<div className="min-h-screen bg-primary-50">
|
||||
<Sidebar />
|
||||
<div className="pl-64">
|
||||
<Header />
|
||||
<main className="p-6">{children}</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SiteProvider>
|
||||
</AuthProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user