From 3227c7bc6bd233c92b1cf54bec689f0582dca547 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Mon, 1 Dec 2025 22:25:56 +0100 Subject: refactor: replace StopSheet with StopSummarySheet and update related components - Deleted StopSheet and StopSheetSkeleton components. - Introduced StopSummarySheet and StopSummarySheetSkeleton components. - Updated ConsolidatedCirculationCard to support a reduced view. - Modified ConsolidatedCirculationList to accept a reduced prop. - Adjusted map route to use StopSummarySheet. - Cleaned up CSS styles related to the stop sheet components. - Enhanced error handling and loading states in the new summary sheet. - Updated stop report logic to filter out empty next streets. --- src/frontend/app/routes/stops-$id.tsx | 88 ++++++++++++++++------------------- 1 file changed, 39 insertions(+), 49 deletions(-) (limited to 'src/frontend/app/routes/stops-$id.tsx') diff --git a/src/frontend/app/routes/stops-$id.tsx b/src/frontend/app/routes/stops-$id.tsx index 25aa3e7..32152f9 100644 --- a/src/frontend/app/routes/stops-$id.tsx +++ b/src/frontend/app/routes/stops-$id.tsx @@ -1,4 +1,4 @@ -import { Edit2, RefreshCw, Star } from "lucide-react"; +import { Eye, EyeClosed, RefreshCw, Star } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router"; @@ -88,6 +88,7 @@ export default function Estimates() { const [favourited, setFavourited] = useState(false); const [isManualRefreshing, setIsManualRefreshing] = useState(false); const [isMapModalOpen, setIsMapModalOpen] = useState(false); + const [isReducedView, setIsReducedView] = useState(false); const [selectedCirculationId, setSelectedCirculationId] = useState< string | undefined >(undefined); @@ -185,49 +186,9 @@ export default function Estimates() { } }; - const handleRename = () => { - const current = getStopDisplayName(); - const input = window.prompt("Custom name for this stop:", current); - if (input === null) return; // cancelled - const trimmed = input.trim(); - if (trimmed === "") { - StopDataProvider.removeCustomName(stopIdNum); - setCustomName(undefined); - } else { - StopDataProvider.setCustomName(stopIdNum, trimmed); - setCustomName(trimmed); - } - }; - return (
-
-
- - -
- - -
- {stopData && stopData.lines && stopData.lines.length > 0 && (
{stopData.lines.map((line) => ( @@ -253,14 +214,43 @@ export default function Estimates() { )} /> ) : data ? ( - { - setSelectedCirculationId(getCirculationId(estimate)); - setIsMapModalOpen(true); - }} - /> + <> +
+
+ + + +
+ +
+ {t("estimates.caption", "Estimaciones de llegadas a las {{time}}", { + time: dataDate?.toLocaleTimeString(), + })} +
+ +
+ {isReducedView ? ( + setIsReducedView(false)} /> + ) : ( + setIsReducedView(true)} /> + )} +
+
+ { + setSelectedCirculationId(getCirculationId(estimate)); + setIsMapModalOpen(true); + }} + /> + ) : null}
-- cgit v1.3