fix: address critical and major PR review issues
- 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>
This commit is contained in:
+12
-9
@@ -1,6 +1,7 @@
|
||||
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'
|
||||
@@ -31,15 +32,17 @@ export default function App() {
|
||||
<Routes>
|
||||
<Route element={<Layout />}>
|
||||
<Route index element={<Dashboard />} />
|
||||
<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 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 />} />
|
||||
|
||||
Reference in New Issue
Block a user