From c5e590e177ab04a5cc6ed8c515df436e8e82e236 Mon Sep 17 00:00:00 2001 From: Cora Grant Date: Fri, 19 Apr 2024 15:25:39 -0400 Subject: [PATCH] fix: missing route pills on Solari screens The refactor of this logic to address type errors in 1f411cb was incorrect and ended up breaking text route pills (e.g. bus numbers, commuter rail track numbers). The variable mistakenly named `routeImg` here was intended to be an image-or-string. --- assets/src/components/solari/route_pill.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/src/components/solari/route_pill.tsx b/assets/src/components/solari/route_pill.tsx index 2e27d53c8..7f9f4abb2 100644 --- a/assets/src/components/solari/route_pill.tsx +++ b/assets/src/components/solari/route_pill.tsx @@ -69,31 +69,33 @@ const routeToPill = ( }; const Pill = ({ routeName, routePillColor }: PillType): JSX.Element => { - let routeImg: JSX.Element | undefined; + let route: JSX.Element | string | null; if (routeName === "CR") { - routeImg = ( + route = ( ); } else if (routeName === "Boat") { - routeImg = ( + route = ( ); } else if (routeName === "BUS") { - routeImg = ( + route = ( ); + } else { + route = routeName; } return (
- {routeImg && } + {route && }
); };