diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2026-02-11 18:18:13 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2026-02-11 18:18:13 +0100 |
| commit | f3a8efbacf185638cacea0693824d9de894c89b3 (patch) | |
| tree | c7bc56f74a8738e09963656895448df50df39417 /src/frontend/app | |
| parent | 58d309b69bcc80a215c4fd6f38044b820d4f3674 (diff) | |
refactor: Remove unused logging and streamline stop data handling in map and processor components
Diffstat (limited to 'src/frontend/app')
| -rw-r--r-- | src/frontend/app/components/map/StopSummarySheet.tsx | 11 | ||||
| -rw-r--r-- | src/frontend/app/routes/map.tsx | 24 |
2 files changed, 4 insertions, 31 deletions
diff --git a/src/frontend/app/components/map/StopSummarySheet.tsx b/src/frontend/app/components/map/StopSummarySheet.tsx index 7024f41..7b4dd7b 100644 --- a/src/frontend/app/components/map/StopSummarySheet.tsx +++ b/src/frontend/app/components/map/StopSummarySheet.tsx @@ -18,11 +18,6 @@ export interface StopSheetProps { stopCode?: string; stopFeed?: string; name: string; - lines: { - line: string; - colour?: string; - textColour?: string; - }[]; }; } @@ -57,10 +52,10 @@ export const StopSummarySheet: React.FC<StopSheetProps> = ({ </div> <div className={`flex flex-wrap flex-row gap-2`}> - {stop.lines.map((lineObj) => ( + {data?.routes.map((lineObj) => ( <LineIcon - key={lineObj.line} - line={lineObj.line} + key={lineObj.shortName} + line={lineObj.shortName} mode="pill" colour={lineObj.colour} textColour={lineObj.textColour} diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx index a8d745e..c9c4850 100644 --- a/src/frontend/app/routes/map.tsx +++ b/src/frontend/app/routes/map.tsx @@ -111,10 +111,7 @@ export default function StopMap() { }; const stopLayerFilter = useMemo(() => { - const filter: any[] = [ - "any", - ["==", ["get", "transitKind"], "unknown"] - ]; + const filter: any[] = ["any", ["==", ["get", "transitKind"], "unknown"]]; if (showCitybusStops) { filter.push(["==", ["get", "transitKind"], "bus"]); } @@ -127,11 +124,6 @@ export default function StopMap() { return filter as FilterSpecification; }, [showCitybusStops, showIntercityBusStops, showTrainStops]); - const getLatitude = (center: any) => - Array.isArray(center) ? center[0] : center.lat; - const getLongitude = (center: any) => - Array.isArray(center) ? center[1] : center.lng; - const handlePointClick = (feature: any) => { const props: { id: string; @@ -145,24 +137,10 @@ export default function StopMap() { return; } - const stopId = props.id; - const routes: { - shortName: string; - colour: string; - textColour: string; - }[] = JSON.parse(props.routes || "[]"); - setSelectedStop({ stopId: props.id, stopCode: props.code, name: props.name || "Unknown Stop", - lines: routes.map((route) => { - return { - line: route.shortName, - colour: route.colour, - textColour: route.textColour, - }; - }), }); setIsSheetOpen(true); }; |
