Skip to content

Commit

Permalink
refactor(DefaultRouteRenderer): Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Sep 6, 2024
1 parent d4ea7d2 commit 54c7207
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/components/narrative/metro/default-route-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ const DefaultRouteRenderer = ({
style
}: RouteRendererProps): JSX.Element => {
const routeTitle =
leg.route?.shortName ||
leg.route?.longName ||
leg.routeShortName ||
leg.routeLongName
typeof leg.route === 'object'
? leg.route.shortName || leg.route.longName
: leg.routeShortName || leg.routeLongName
return (
<Block
color={leg.route?.color || leg.routeColor || '333333'}
color={
(typeof leg.route === 'object' ? leg.route.color : leg.routeColor) ||
'333333'
}
isOnColoredBackground={leg.onColoredBackground}
style={style}
title={routeTitle}
Expand Down

0 comments on commit 54c7207

Please sign in to comment.