-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add walking legs to the trip plan details (#2246)
* walking leg nearly complete * update to use the latest metro * docs * format * remove extra * remove id from accordion * change gray color * mix lock * mix format more files
- Loading branch information
1 parent
557ce23
commit ad2a7f2
Showing
29 changed files
with
191 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
defmodule DotcomWeb.Components.TripPlanner.WalkingLeg do | ||
@moduledoc """ | ||
A walking leg of a trip. | ||
Includes a summary of the walk (time and distance) and a list of steps. | ||
""" | ||
|
||
use Phoenix.Component | ||
|
||
import MbtaMetro.Components.Accordion, only: [accordion: 1] | ||
import MbtaMetro.Components.Icon, only: [icon: 1] | ||
import MbtaMetro.Components.List, only: [list: 1] | ||
|
||
alias OpenTripPlannerClient.Schema.Step | ||
|
||
@doc """ | ||
Renders a walking leg. | ||
Must be given a `leg` with a: | ||
- `distance` (float) in miles | ||
- `duration` (integer) in minutes | ||
- `mode` with a list of `steps` (list of `Step` structs) | ||
""" | ||
|
||
attr :leg, :map, required: true | ||
|
||
def walking_leg(assigns) do | ||
~H""" | ||
<hr class="my-2 border-t-solid border-slate-300" /> | ||
<.accordion> | ||
<:heading> | ||
<.icon name="person-walking" class="w-5 h-5 mr-1 fill-black" /> | ||
<div class="text-black"> | ||
<div class="text-base"> | ||
Walk | ||
</div> | ||
<div class="text-sm"> | ||
{@leg.duration} min, {@leg.distance} mi | ||
</div> | ||
</div> | ||
</:heading> | ||
<:content> | ||
<.list class="w-full m-0 ps-0"> | ||
<:item :for={step <- @leg.mode.steps}> | ||
<span class="text-sm"> | ||
{Step.walk_summary(step)} | ||
</span> | ||
</:item> | ||
</.list> | ||
</:content> | ||
</.accordion> | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.