Skip to content

Commit

Permalink
ui(TripPlanner): Use small bus icons in trip planner transit legs (#2279
Browse files Browse the repository at this point in the history
)
  • Loading branch information
joshlarson authored Dec 19, 2024
1 parent 1c3eedc commit 7675dcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dotcom_web/components/route_symbols.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion lib/dotcom_web/components/trip_planner/transit_leg.ex
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ defmodule DotcomWeb.Components.TripPlanner.TransitLeg do

~H"""
<div class="flex items-start gap-1.5">
<.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)}
/>
<div class="flex flex-col">
<span class="font-bold">{@headsign}</span>
Expand All @@ -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)
Expand Down

0 comments on commit 7675dcc

Please sign in to comment.