mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix: Move FloatingChatButton and GlobalChatPane inside Router
The ModelSelector component uses useNavigate which requires Router context. Move the floating chat components from App.tsx into AppRouter.tsx where they have access to the BrowserRouter/HashRouter context.
This commit is contained in:
1 parent
68702abc41
commit
15c8040e35
2 files changed
+5
-4
No files matched your search
@@ -29,8 +29,6 @@ import { OfflineIndicator } from '@/components/OfflineIndicator';
|
||||
import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt';
|
||||
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
||||
import { GlobalChatProvider } from '@/components/GlobalChatProvider';
|
||||
import { FloatingChatButton } from '@/components/FloatingChatButton';
|
||||
import { GlobalChatPane } from '@/components/GlobalChatPane';
|
||||
|
||||
import AppRouter from './AppRouter';
|
||||
|
||||
@@ -189,8 +187,6 @@ export function App() {
|
||||
<Suspense>
|
||||
<AppRouter />
|
||||
</Suspense>
|
||||
<FloatingChatButton />
|
||||
<GlobalChatPane />
|
||||
</TooltipProvider>
|
||||
</GlobalChatProvider>
|
||||
</SessionManagerProvider>
|
||||
|
||||
@@ -2,6 +2,8 @@ import { BrowserRouter, HashRouter, Route, Routes } from "react-router-dom";
|
||||
import { ScrollToTop } from "./components/ScrollToTop";
|
||||
import { SessionMonitor } from "./components/SessionMonitor";
|
||||
import { URLFragmentHandler } from "./components/URLFragmentHandler";
|
||||
import { FloatingChatButton } from "./components/FloatingChatButton";
|
||||
import { GlobalChatPane } from "./components/GlobalChatPane";
|
||||
|
||||
import Index from "./pages/Index";
|
||||
import Clone from "./pages/Clone";
|
||||
@@ -56,6 +58,9 @@ export function AppRouter() {
|
||||
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
{/* Global floating chat - available on all pages */}
|
||||
<FloatingChatButton />
|
||||
<GlobalChatPane />
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user