Skip to content

Commit

Permalink
tweak: Move turn by turn directions in side panel (#2904)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahpurcell authored Dec 5, 2024
1 parent 52748fe commit 8d6a841
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions assets/src/components/detours/detourPanels/activeDetourPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ export const ActiveDetourPanel = ({
routeDirection={routeDirection}
/>

{connectionPoints && (
<ConnectionPoints connectionPoints={connectionPoints} />
)}

{missedStops && <MissedStops missedStops={missedStops} />}

<section className="pb-3">
<h2 className="c-diversion-panel__h2">Detour Directions</h2>
{directions ? (
Expand All @@ -102,6 +96,12 @@ export const ActiveDetourPanel = ({
</ListGroup>
) : null}
</section>

{connectionPoints && (
<ConnectionPoints connectionPoints={connectionPoints} />
)}

{missedStops && <MissedStops missedStops={missedStops} />}
</Panel.Body.ScrollArea>

<Panel.Body.Footer>
Expand Down
12 changes: 6 additions & 6 deletions assets/src/components/detours/detourPanels/pastDetourPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ export const PastDetourPanel = ({
routeDirection={routeDirection}
/>

{connectionPoints && (
<ConnectionPoints connectionPoints={connectionPoints} />
)}

{missedStops && <MissedStops missedStops={missedStops} />}

<section className="pb-3">
<h2 className="c-diversion-panel__h2">Detour Directions</h2>
{directions ? (
Expand All @@ -87,6 +81,12 @@ export const PastDetourPanel = ({
</ListGroup>
) : null}
</section>

{connectionPoints && (
<ConnectionPoints connectionPoints={connectionPoints} />
)}

{missedStops && <MissedStops missedStops={missedStops} />}
</Panel.Body.ScrollArea>
</Panel.Body>
</Panel>
Expand Down
10 changes: 5 additions & 5 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ export const DiversionPage = ({
`Detour ${routeName} ${routeDirection}`,
routeOrigin,
,
"Turn-by-Turn Directions:",
...(editedDirections
? [editedDirections]
: extendedDirections?.map((v) => v.instruction) ?? []),
,
"Connection Points:",
connectionPoints?.start?.name ?? "N/A",
connectionPoints?.end?.name ?? "N/A",
,
`Missed Stops (${missedStops?.length}):`,
...(missedStops?.map(({ name }) => name) ?? ["no stops"]),
,
"Turn-by-Turn Directions:",
...(editedDirections
? [editedDirections]
: extendedDirections?.map((v) => v.instruction) ?? []),
].join("\n")

const routes = useContext(RoutesContext)
Expand Down
14 changes: 7 additions & 7 deletions assets/tests/components/detours/diversionPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1291,19 +1291,19 @@ describe("DiversionPage", () => {
`Detour ${routeName} ${routeDirection}`,
routeOrigin,
,
"Connection Points:",
start.name,
end.name,
,
`Missed Stops (${stops.length}):`,
...stops.map(({ name }) => name),
,
"Turn-by-Turn Directions:",
"From Avenue 1 & Street 2",
"Turn left on Main Street",
"Turn right on High Street",
"Turn sharp right on Broadway",
"Regular Route",
,
"Connection Points:",
start.name,
end.name,
,
`Missed Stops (${stops.length}):`,
...stops.map(({ name }) => name),
].join("\n")
)
)
Expand Down

0 comments on commit 8d6a841

Please sign in to comment.