Skip to content

Commit d8defa2

Browse files
Merge pull request #1407 from opentripplanner/remove-stop-id-when-no-stop-code
remove stop id from nearby view side panel
2 parents 6865d28 + 50b3e52 commit d8defa2

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

__tests__/components/viewers/__snapshots__/nearby-view.js.snap

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18425,17 +18425,6 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = `
1842518425
className="sc-hJxDiT gGpYuf"
1842618426
>
1842718427
<div>
18428-
<FormattedMessage
18429-
id="components.StopViewer.displayStopId"
18430-
values={
18431-
Object {
18432-
"stopId": "40:990003",
18433-
"strong": [Function],
18434-
}
18435-
}
18436-
>
18437-
components.StopViewer.displayStopId
18438-
</FormattedMessage>
1843918428
<Styled(Connect(Component))
1844018429
className="stop-header-action"
1844118430
to="/schedule/40:990003"
@@ -47000,17 +46989,6 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = `
4700046989
className="sc-hJxDiT gGpYuf"
4700146990
>
4700246991
<div>
47003-
<FormattedMessage
47004-
id="components.StopViewer.displayStopId"
47005-
values={
47006-
Object {
47007-
"stopId": "40:990004",
47008-
"strong": [Function],
47009-
}
47010-
}
47011-
>
47012-
components.StopViewer.displayStopId
47013-
</FormattedMessage>
4701446992
<Styled(Connect(Component))
4701546993
className="stop-header-action"
4701646994
to="/schedule/40:990004"

lib/components/viewers/nearby/stop-card-header.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ const StopCardHeader = ({
6060
</CardHeader>
6161
<CardBody>
6262
<div>
63-
<FormattedMessage
64-
id="components.StopViewer.displayStopId"
65-
values={{
66-
stopId: stopData.code || stopData.gtfsId,
67-
strong: Strong
68-
}}
69-
/>
63+
{stopData.code ? (
64+
<FormattedMessage
65+
id="components.StopViewer.displayStopId"
66+
values={{
67+
stopId: stopData.code,
68+
strong: Strong
69+
}}
70+
/>
71+
) : null}
7072
{onZoomClick ? (
7173
<button
7274
className="link-button"

0 commit comments

Comments
 (0)