diff --git a/assets/css/_diversion_page.scss b/assets/css/_diversion_page.scss index 846b25ef3..0990e19f2 100644 --- a/assets/css/_diversion_page.scss +++ b/assets/css/_diversion_page.scss @@ -44,10 +44,14 @@ .l-diversion-page__header { border-bottom: none; } + + .l-diversion-page-panel__header { + align-items: center; + } + .c-diversion-panel__header_text, .c-detour-panel__subheader, - .c-diversion-panel__back-button-container, - .c-active-detour__alert-icon { + .c-diversion-panel__desktop-buttons { display: none !important; } } @@ -89,7 +93,7 @@ } } - .l-diversion-page-panel__header .c-diversion-panel__back-button { + .l-diversion-page-panel__header .c-diversion-panel__outline-button--back { display: none; } } @@ -161,3 +165,14 @@ height: 1.5rem; width: 1.5rem; } + +.c-diversion-panel__outline-button { + height: 2rem; + border-radius: 0.2rem; + font-size: 0.875rem; + padding: 0.375rem 0.5rem; + + &--copy { + margin: 0.78125rem 0; + } +} diff --git a/assets/src/components/detours/detourPanelComponents.tsx b/assets/src/components/detours/detourPanelComponents.tsx index 384f96138..a8937d3c2 100644 --- a/assets/src/components/detours/detourPanelComponents.tsx +++ b/assets/src/components/detours/detourPanelComponents.tsx @@ -1,8 +1,15 @@ import React from "react" import { Stop } from "../../schedule" -import { Badge, ListGroup } from "react-bootstrap" +import { + Badge, + Button, + ListGroup, + OverlayTrigger, + Popover, +} from "react-bootstrap" import { uniqBy } from "../../helpers/array" import { RoutePill } from "../routePill" +import { Files } from "../../helpers/bsIcons" interface MissedStopsProps { missedStops?: Stop[] @@ -64,3 +71,26 @@ export const AffectedRoute = ({ ) + +export const CopyButton = ({ detourText }: { detourText: string }) => ( + + Copied to clipboard! + + } + > + + +) diff --git a/assets/src/components/detours/detourPanels/activeDetourPanel.tsx b/assets/src/components/detours/detourPanels/activeDetourPanel.tsx index 24ee0983a..94e6de7e6 100644 --- a/assets/src/components/detours/detourPanels/activeDetourPanel.tsx +++ b/assets/src/components/detours/detourPanels/activeDetourPanel.tsx @@ -8,9 +8,15 @@ import { ExclamationTriangleFill, StopCircle, } from "../../../helpers/bsIcons" -import { AffectedRoute, MissedStops } from "../detourPanelComponents" +import { + AffectedRoute, + CopyButton, + MissedStops, +} from "../detourPanelComponents" +import inTestGroup, { TestGroups } from "../../../userInTestGroup" export interface ActiveDetourPanelProps extends PropsWithChildren { + detourText: string directions?: DetourDirection[] connectionPoints?: string[] missedStops?: Stop[] @@ -23,6 +29,7 @@ export interface ActiveDetourPanelProps extends PropsWithChildren { } export const ActiveDetourPanel = ({ + detourText, directions, connectionPoints, missedStops, @@ -36,7 +43,7 @@ export const ActiveDetourPanel = ({ }: ActiveDetourPanelProps) => { const backButton = ( - {onActivateDetour && (

View Draft Detour

+
- -
+ />
@@ -1161,16 +1173,35 @@ exports[`Detours Page: Open a Detour renders detour details modal to match mocke class="l-diversion-page__panel text-bg-light" >

View Draft Detour

+
- -
+ />
diff --git a/assets/tests/components/detours/diversionPage.test.tsx b/assets/tests/components/detours/diversionPage.test.tsx index 63bc288e3..f18f82465 100644 --- a/assets/tests/components/detours/diversionPage.test.tsx +++ b/assets/tests/components/detours/diversionPage.test.tsx @@ -1217,7 +1217,7 @@ describe("DiversionPage", () => { await userEvent.click(reviewDetourButton.get()) - expect(screen.getByRole("button", { name: "Copy Details" })).toBeVisible() + expect(screen.getByRole("button", { name: "Copy details" })).toBeVisible() }) test("'View Draft Detour' screen copies text content to clipboard when clicked copy details button", async () => { @@ -1283,7 +1283,7 @@ describe("DiversionPage", () => { await userEvent.click(reviewDetourButton.get()) - await userEvent.click(screen.getByRole("button", { name: "Copy Details" })) + await userEvent.click(screen.getByRole("button", { name: "Copy details" })) await waitFor(() => expect(window.navigator.clipboard.readText()).resolves.toBe(