-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Contents for past detour page (#2817)
- Loading branch information
1 parent
c067e65
commit 824e0ab
Showing
4 changed files
with
111 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,85 @@ | ||
import React from "react" | ||
import { Panel } from "./diversionPage" | ||
import { DetourDirection } from "../../models/detour" | ||
import { Stop } from "../../schedule" | ||
import { ArrowLeft } from "../../helpers/bsIcons" | ||
import { Button, ListGroup } from "react-bootstrap" | ||
import { AffectedRoute, MissedStops } from "./detourPanelComponents" | ||
|
||
export const PastDetourPanel = () => ( | ||
export interface PastDetourPanelProps { | ||
directions?: DetourDirection[] | ||
connectionPoints: [string, string] | ||
missedStops?: Stop[] | ||
routeName: string | ||
routeDescription: string | ||
routeOrigin: string | ||
routeDirection: string | ||
onNavigateBack: () => void | ||
} | ||
|
||
export const PastDetourPanel = ({ | ||
directions, | ||
connectionPoints: [connectionPointStart, connectionPointEnd], | ||
missedStops, | ||
routeName, | ||
routeDescription, | ||
routeOrigin, | ||
routeDirection, | ||
onNavigateBack, | ||
}: PastDetourPanelProps) => ( | ||
<Panel as="article"> | ||
<Panel.Header className=""> | ||
<h1 className="c-diversion-panel__h1 my-3">Past Detour</h1> | ||
<h1 className="c-diversion-panel__h1 my-3">View Past Detour</h1> | ||
</Panel.Header> | ||
|
||
<Panel.Body className="d-flex flex-column"></Panel.Body> | ||
<Panel.Body className="d-flex flex-column"> | ||
<Panel.Body.ScrollArea> | ||
<div className="d-flex justify-content-between align-items-center"> | ||
{onNavigateBack && ( | ||
<Button | ||
className="icon-link my-3" | ||
variant="outline-primary" | ||
onClick={onNavigateBack} | ||
> | ||
<ArrowLeft /> | ||
Back | ||
</Button> | ||
)} | ||
</div> | ||
<AffectedRoute | ||
routeName={routeName} | ||
routeDescription={routeDescription} | ||
routeOrigin={routeOrigin} | ||
routeDirection={routeDirection} | ||
/> | ||
|
||
<section className="pb-3"> | ||
<h2 className="c-diversion-panel__h2">Connection Points</h2> | ||
<ListGroup as="ul"> | ||
<ListGroup.Item>{connectionPointStart}</ListGroup.Item> | ||
<ListGroup.Item>{connectionPointEnd}</ListGroup.Item> | ||
</ListGroup> | ||
</section> | ||
|
||
<MissedStops missedStops={missedStops} /> | ||
|
||
<section className="pb-3"> | ||
<h2 className="c-diversion-panel__h2">Detour Directions</h2> | ||
{directions ? ( | ||
<ListGroup as="ol"> | ||
{directions.map((d) => ( | ||
<ListGroup.Item key={d.instruction} as="li"> | ||
{d.instruction == "Regular Route" ? ( | ||
<strong className="fw-medium">{d.instruction}</strong> | ||
) : ( | ||
d.instruction | ||
)} | ||
</ListGroup.Item> | ||
))} | ||
</ListGroup> | ||
) : null} | ||
</section> | ||
</Panel.Body.ScrollArea> | ||
</Panel.Body> | ||
</Panel> | ||
) |
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