From 7675dcc5265dde98303be9b268b9ae0c5f0814ff Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Thu, 19 Dec 2024 15:46:36 -0500 Subject: [PATCH] ui(TripPlanner): Use small bus icons in trip planner transit legs (#2279) --- lib/dotcom_web/components/route_symbols.ex | 2 +- lib/dotcom_web/components/trip_planner/transit_leg.ex | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/dotcom_web/components/route_symbols.ex b/lib/dotcom_web/components/route_symbols.ex index 1100502b9f..fed21a67ed 100644 --- a/lib/dotcom_web/components/route_symbols.ex +++ b/lib/dotcom_web/components/route_symbols.ex @@ -16,7 +16,7 @@ defmodule DotcomWeb.Components.RouteSymbols do variant( :size, [ - small: "rounded-[3px] px-[2px] py-[2px] min-w-6 text-sm", + small: "rounded-[3px] px-[2px] py-[2px] min-w-8 text-sm", default: "rounded-[4px] px-[4px] py-[4px] min-w-10" ], default: :default diff --git a/lib/dotcom_web/components/trip_planner/transit_leg.ex b/lib/dotcom_web/components/trip_planner/transit_leg.ex index 6d98eb251f..c9dc6f9b59 100644 --- a/lib/dotcom_web/components/trip_planner/transit_leg.ex +++ b/lib/dotcom_web/components/trip_planner/transit_leg.ex @@ -173,7 +173,11 @@ defmodule DotcomWeb.Components.TripPlanner.TransitLeg do ~H"""
- <.route_symbol class="shrink-0" route={@leg.mode.route} /> + <.route_symbol + class="shrink-0" + route={@leg.mode.route} + size={route_symbol_size(@leg.mode.route)} + />
{@headsign} @@ -189,6 +193,9 @@ defmodule DotcomWeb.Components.TripPlanner.TransitLeg do """ end + defp route_symbol_size(%Route{type: 3} = route) when not is_external?(route), do: "small" + defp route_symbol_size(_), do: "default" + # Massport trips might not have headsigns, so use the route names instead defp headsign(%{route: %Route{} = route}) when is_external?(route) do route_name(route)