Skip to content

Commit

Permalink
tweak: Move turn by turn directions in side panel
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahpurcell committed Nov 26, 2024
1 parent 70c3a07 commit dbf1345
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 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
6 changes: 3 additions & 3 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ export const DiversionPage = ({
`Detour ${routeName} ${routeDirection}`,
routeOrigin,
,
"Turn-by-Turn Directions:",
...(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:",
...(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 dbf1345

Please sign in to comment.