diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-07 14:58:32 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-07 14:58:32 +0100 |
| commit | 52256fd634300b39b915bf1db6020d9d2871a0b4 (patch) | |
| tree | d32b219427e5974026c544132e3b0a65ffa0a82e /src/frontend/app/routes/estimates-$id.tsx | |
| parent | 4420def7411a053e930b44117e2bf63625d824dc (diff) | |
Implement experimental consolidated circulation view
Diffstat (limited to 'src/frontend/app/routes/estimates-$id.tsx')
| -rw-r--r-- | src/frontend/app/routes/estimates-$id.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/frontend/app/routes/estimates-$id.tsx b/src/frontend/app/routes/estimates-$id.tsx index 4502d9e..81c83ea 100644 --- a/src/frontend/app/routes/estimates-$id.tsx +++ b/src/frontend/app/routes/estimates-$id.tsx @@ -1,5 +1,5 @@ import { type JSX, useEffect, useState, useCallback } from "react"; -import { useParams, Link } from "react-router"; +import { useParams, Link, Navigate } from "react-router"; import StopDataProvider, { type Stop } from "../data/StopDataProvider"; import { Star, Edit2, ExternalLink, RefreshCw } from "lucide-react"; import "./estimates-$id.css"; @@ -105,6 +105,11 @@ export default function Estimates() { const { tableStyle, region } = useApp(); const regionConfig = getRegionConfig(region); + // Redirect to /stops/$id if table style is experimental_consolidated + if (tableStyle === "experimental_consolidated") { + return <Navigate to={`/stops/${params.id}`} replace />; + } + const parseError = (error: any): ErrorInfo => { if (!navigator.onLine) { return { type: "network", message: "No internet connection" }; @@ -171,10 +176,6 @@ export default function Estimates() { } }, [params.id, region, regionConfig.timetableEndpoint]); - const refreshData = useCallback(async () => { - await Promise.all([loadEstimatesData(), loadTimetableDataAsync()]); - }, [loadEstimatesData, loadTimetableDataAsync]); - // Manual refresh function for pull-to-refresh and button const handleManualRefresh = useCallback(async () => { try { @@ -299,7 +300,7 @@ export default function Estimates() { {stopData && stopData.lines && stopData.lines.length > 0 && ( <div - className={`estimates-lines-container ${stopData.lines.length >= 6 ? "scrollable" : ""}`} + className={`estimates-lines-container`} > {stopData.lines.map((line) => ( <div key={line} className="estimates-line-icon"> |
