bc437cce92
Fixes:
- Dashboard: featured most-recent activity card with map + stats
- Maps default to Street; preferCanvas + larger tile buffer for smoother pan/zoom
- Running cadence as colour-banded dots + 165 spm guide line
- Routes: inline row expansion, rename (PATCH /routes/{id}), podium + deltas, tiled map
- Records: remove reversed pace Y-axis
- Profile: remove resting HR; add goal weight
- Health: snapshot weight carry-forward; VO2 trend axis 30-70;
weight goal line + kg/st-lb toggle + axis max; sleep 8h/avg lines
- Garmin sync progress moved to global store with persistent floating bar
Features:
- Speed-coloured activity route (default) with Speed/Solid toggle
- GPS-geometry segments: draw on map, match across all activities,
1st/2nd/3rd leaderboard + podium badges (replaces old distance segments)
- Lap bests: best time per lap across a route + delta column
- Body Battery: highlight activity time windows
Schema: users.goal_weight_kg ALTER; new segments/segment_efforts tables.
Removes RouteSegment, the Segments page, and segment-bests endpoints.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.6 KiB
React
46 lines
1.6 KiB
React
import { Routes, Route, Navigate } from 'react-router-dom'
|
|
import { useEffect } from 'react'
|
|
import { useAuthStore } from './hooks/useAuth'
|
|
import Layout from './components/ui/Layout'
|
|
import LoginPage from './pages/LoginPage'
|
|
import DashboardPage from './pages/DashboardPage'
|
|
import ActivitiesPage from './pages/ActivitiesPage'
|
|
import ActivityDetailPage from './pages/ActivityDetailPage'
|
|
import HealthPage from './pages/HealthPage'
|
|
import RoutesPage from './pages/RoutesPage'
|
|
import RecordsPage from './pages/RecordsPage'
|
|
import UploadPage from './pages/UploadPage'
|
|
import ProfilePage from './pages/ProfilePage'
|
|
import UsersPage from './pages/UsersPage'
|
|
|
|
function RequireAuth({ children }) {
|
|
const token = useAuthStore((s) => s.token)
|
|
if (!token) return <Navigate to="/login" replace />
|
|
return children
|
|
}
|
|
|
|
export default function App() {
|
|
const { token, fetchUser } = useAuthStore()
|
|
|
|
useEffect(() => {
|
|
if (token) fetchUser()
|
|
}, [token])
|
|
|
|
return (
|
|
<Routes>
|
|
<Route path="/login" element={<LoginPage />} />
|
|
<Route path="/" element={<RequireAuth><Layout /></RequireAuth>}>
|
|
<Route index element={<DashboardPage />} />
|
|
<Route path="activities" element={<ActivitiesPage />} />
|
|
<Route path="activities/:id" element={<ActivityDetailPage />} />
|
|
<Route path="health" element={<HealthPage />} />
|
|
<Route path="routes" element={<RoutesPage />} />
|
|
<Route path="records" element={<RecordsPage />} />
|
|
<Route path="upload" element={<UploadPage />} />
|
|
<Route path="profile" element={<ProfilePage />} />
|
|
<Route path="users" element={<UsersPage />} />
|
|
</Route>
|
|
</Routes>
|
|
)
|
|
}
|