Skip to content

Commit

Permalink
fix(DefaultRouteRenderer): Prefer OTP2 leg route data.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Sep 6, 2024
1 parent 8bfd731 commit cf68453
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/components/narrative/metro/default-route-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ const DefaultRouteRenderer = ({
leg,
style
}: RouteRendererProps): JSX.Element => {
const routeTitle = leg.routeShortName || leg.routeLongName
const routeTitle =
leg.route?.shortName ||
leg.route?.longName ||
leg.routeShortName ||
leg.routeLongName
return (
<Block
color={leg.routeColor || '333333'}
color={leg.route?.color || leg.routeColor || '333333'}
isOnColoredBackground={leg.onColoredBackground}
style={style}
title={routeTitle}
Expand Down

0 comments on commit cf68453

Please sign in to comment.