diff --git a/src/App.tsx b/src/App.tsx index 559d9ae0..1fe2424c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,6 +5,7 @@ import { TooltipProvider } from "@/components/ui/tooltip"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { BrowserRouter, Routes, Route } from "react-router-dom"; import { AuthProvider } from "@/hooks/useAuth"; +import { useLocationAutoDetect } from "@/hooks/useLocationAutoDetect"; import { Footer } from "@/components/layout/Footer"; import Index from "./pages/Index"; import Parks from "./pages/Parks"; @@ -24,11 +25,12 @@ import AdminSettings from "./pages/AdminSettings"; const queryClient = new QueryClient(); -const App = () => ( - - - - +function AppContent() { + useLocationAutoDetect(); + + return ( + +
@@ -57,6 +59,13 @@ const App = () => (
+ ); +} + +const App = () => ( + + + ); diff --git a/src/main.tsx b/src/main.tsx index 4cc81906..e18433e1 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,15 +3,9 @@ import { createRoot } from "react-dom/client"; import App from "./App.tsx"; import "./index.css"; import { ThemeProvider } from "@/components/theme/ThemeProvider"; -import { useLocationAutoDetect } from "./hooks/useLocationAutoDetect"; - -function AppWithAutoDetect() { - useLocationAutoDetect(); - return ; -} createRoot(document.getElementById("root")!).render( - + );