From 8a0ed776d78ab1a6ba8c6cb0eaa9ea016a88aca3 Mon Sep 17 00:00:00 2001 From: Daniel Heppner Date: Wed, 18 Oct 2023 10:49:46 -0700 Subject: [PATCH] bring back functional stopviewer --- lib/actions/ui.js | 5 +++-- lib/components/viewers/nearby/stop.tsx | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/actions/ui.js b/lib/actions/ui.js index 0e3c9b97d..7be1c9fc1 100644 --- a/lib/actions/ui.js +++ b/lib/actions/ui.js @@ -178,7 +178,8 @@ export function setViewedStop(payload, viewer = 'nearby') { dispatch(setViewedNearbyCoords(payload)) } else { dispatch(viewStop(payload)) - const path = getPathFromParts('stop', payload.id) + const path = getPathFromParts('stop', payload.stopId) + console.log(path) if (payload) dispatch(routeTo(path)) } } @@ -240,7 +241,7 @@ export function matchContentToUrl(map, location) { break case 'stop': if (id) { - dispatch(setViewedStop({ stopId: id })) + dispatch(setViewedStop({ stopId: id }, 'stop')) } else { dispatch(setViewedStop(null)) dispatch(setMainPanelContent(MainPanelContent.STOP_VIEWER)) diff --git a/lib/components/viewers/nearby/stop.tsx b/lib/components/viewers/nearby/stop.tsx index 6fa252d8b..c2d67b4e0 100644 --- a/lib/components/viewers/nearby/stop.tsx +++ b/lib/components/viewers/nearby/stop.tsx @@ -12,6 +12,7 @@ import React from 'react' import * as mapActions from '../../../actions/map' import * as uiActions from '../../../actions/ui' +import { Calendar } from '@styled-icons/fa-solid' import { Card, @@ -34,6 +35,7 @@ type PatternStopTime = { type StopData = Place & { code: string + gtfsId: string stoptimesForPatterns: PatternStopTime[] } @@ -64,6 +66,7 @@ const getTimezoneWarning = (homeTimezone: string): JSX.Element => { type Props = { homeTimezone: string setLocation: (args: any) => void + setViewedStop: (stop: any, nearby: string) => void showOperatorLogo: boolean stopData: StopData zoomToPlace: (map: any, stopData: any) => void @@ -72,6 +75,7 @@ type Props = { const Stop = ({ homeTimezone, setLocation, + setViewedStop, stopData, zoomToPlace }: Props): JSX.Element => { @@ -147,6 +151,15 @@ const Stop = ({ > +