forked from cartsnitch/app
034f12d0aa
- Lazy-load Recharts via SparklineChart component with React.lazy + Suspense - Gate mock auth fallback behind VITE_MOCK_AUTH env var in Login and Register - Add ProtectedRoute component to guard authenticated routes - Fix touch target size on New Alert button (min-h-10 -> min-h-12) - Replace invalid safe-area-pb class with pb-[env(safe-area-inset-bottom)] - Fix theme toggle button touch targets (min-h-10 -> min-h-12) Co-Authored-By: Paperclip <noreply@paperclip.ing>
55 lines
2.2 KiB
TypeScript
55 lines
2.2 KiB
TypeScript
import { BrowserRouter, Routes, Route } from 'react-router-dom'
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
import { Layout } from './components/Layout.tsx'
|
|
import { ProtectedRoute } from './components/ProtectedRoute.tsx'
|
|
import { Dashboard } from './pages/Dashboard.tsx'
|
|
import { Purchases } from './pages/Purchases.tsx'
|
|
import { PurchaseDetail } from './pages/PurchaseDetail.tsx'
|
|
import { Products } from './pages/Products.tsx'
|
|
import { ProductDetail } from './pages/ProductDetail.tsx'
|
|
import { StoreComparison } from './pages/StoreComparison.tsx'
|
|
import { Coupons } from './pages/Coupons.tsx'
|
|
import { Alerts } from './pages/Alerts.tsx'
|
|
import { Settings } from './pages/Settings.tsx'
|
|
import { AccountLinking } from './pages/AccountLinking.tsx'
|
|
import { Login } from './pages/Login.tsx'
|
|
import { Register } from './pages/Register.tsx'
|
|
import { ForgotPassword } from './pages/ForgotPassword.tsx'
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 1000 * 60 * 5,
|
|
retry: 1,
|
|
},
|
|
},
|
|
})
|
|
|
|
export default function App() {
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
<BrowserRouter>
|
|
<Routes>
|
|
<Route element={<Layout />}>
|
|
<Route index element={<Dashboard />} />
|
|
<Route element={<ProtectedRoute />}>
|
|
<Route path="purchases" element={<Purchases />} />
|
|
<Route path="purchases/:id" element={<PurchaseDetail />} />
|
|
<Route path="products" element={<Products />} />
|
|
<Route path="products/:id" element={<ProductDetail />} />
|
|
<Route path="compare/:productId" element={<StoreComparison />} />
|
|
<Route path="coupons" element={<Coupons />} />
|
|
<Route path="alerts" element={<Alerts />} />
|
|
<Route path="settings" element={<Settings />} />
|
|
<Route path="account-linking" element={<AccountLinking />} />
|
|
</Route>
|
|
</Route>
|
|
<Route path="login" element={<Login />} />
|
|
<Route path="register" element={<Register />} />
|
|
<Route path="forgot-password" element={<ForgotPassword />} />
|
|
</Routes>
|
|
</BrowserRouter>
|
|
</QueryClientProvider>
|
|
)
|
|
}
|