Skip to content

Commit

Permalink
refactor: remove duplicate impl of RoutePill size
Browse files Browse the repository at this point in the history
This DUP-specific logic was a duplicate of logic already incorporated
into `RoutePill`, with an added bug that it would not correctly display
a route numbered `200` at small size (if the MBTA had such a route).
  • Loading branch information
digitalcora committed Jul 30, 2024
1 parent 3548363 commit c6823fe
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions assets/src/components/v2/dup/departures/departure_row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ const DepartureRow = ({
times_with_crowding: timesWithCrowding,
currentPage,
}) => {
const routeText = Number(route.text);
return (
<div className="departure-row">
<div className="departure-row__route">
<RoutePill
pill={{
...route,
size: isNaN(routeText) || routeText > 200 ? "small" : "large",
}}
/>
<RoutePill pill={route} />
</div>
<div className="departure-row__destination">
<Destination {...headsign} currentPage={currentPage} />
Expand Down

0 comments on commit c6823fe

Please sign in to comment.