Skip to content

Commit

Permalink
tweak: Rename detourText to copyableDetourText, fix typo (#2879)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahpurcell authored Oct 31, 2024
1 parent fc229f8 commit c9dc3b2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import inTestGroup, { TestGroups } from "../../../userInTestGroup"

export interface ActiveDetourPanelProps extends PropsWithChildren {
detourText: string
copyableDetourText: string
directions?: DetourDirection[]
connectionPoints?: [string, string]
missedStops?: Stop[]
Expand All @@ -30,7 +30,7 @@ export interface ActiveDetourPanelProps extends PropsWithChildren {
}

export const ActiveDetourPanel = ({
detourText,
copyableDetourText,
directions,
connectionPoints,
missedStops,
Expand Down Expand Up @@ -63,7 +63,7 @@ export const ActiveDetourPanel = ({
{backButton}
{/* TODO: temporary test group until I get the copy logic hooked up */}
{inTestGroup(TestGroups.CopyButton) && (
<CopyButton detourText={detourText} />
<CopyButton detourText={copyableDetourText} />
)}
</Panel.Header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Stop } from "../../../schedule"

interface DetourFinishedPanelProps extends PropsWithChildren {
onNavigateBack: () => void
detourText: string
copyableDetourText: string
connectionPoints?: [string, string]
missedStops?: Stop[]
onChangeDetourText: (value: string) => void
Expand All @@ -20,7 +20,7 @@ interface DetourFinishedPanelProps extends PropsWithChildren {

export const DetourFinishedPanel = ({
onNavigateBack,
detourText,
copyableDetourText,
connectionPoints,
missedStops,
onChangeDetourText,
Expand All @@ -30,7 +30,7 @@ export const DetourFinishedPanel = ({
<Panel as="article" className="c-diversion-panel">
<Panel.Header>
<h1 className="c-diversion-panel__h1 my-3">View Draft Detour</h1>
<CopyButton detourText={detourText} />
<CopyButton detourText={copyableDetourText} />
</Panel.Header>

<Panel.Body className="d-flex flex-column">
Expand All @@ -46,7 +46,7 @@ export const DetourFinishedPanel = ({

<Form.Control
as="textarea"
value={detourText}
value={copyableDetourText}
onChange={({ target: { value } }) => onChangeDetourText(value)}
className="flex-grow-1 mb-3"
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import inTestGroup, { TestGroups } from "../../../userInTestGroup"

export interface PastDetourPanelProps {
detourText: string
copyableDetourText: string
directions?: DetourDirection[]
connectionPoints: [string, string]
missedStops?: Stop[]
Expand All @@ -25,7 +25,7 @@ export interface PastDetourPanelProps {
}

export const PastDetourPanel = ({
detourText,
copyableDetourText,
directions,
connectionPoints,
missedStops,
Expand All @@ -40,7 +40,7 @@ export const PastDetourPanel = ({
<h1 className="c-diversion-panel__h1 my-3">View Past Detour</h1>
{/* TODO: temporary test group until I get the copy logic hooked up */}
{inTestGroup(TestGroups.CopyButton) && (
<CopyButton detourText={detourText} />
<CopyButton detourText={copyableDetourText} />
)}
</Panel.Header>

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 @@ -260,7 +260,7 @@ export const DiversionPage = ({
return (
<DetourFinishedPanel
onNavigateBack={editDetour}
detourText={textArea}
copyableDetourText={textArea}
connectionPoints={[
connectionPoints?.start?.name ?? "N/A",
connectionPoints?.end?.name ?? "N/A",
Expand Down Expand Up @@ -350,7 +350,7 @@ export const DiversionPage = ({
} else if (snapshot.matches({ "Detour Drawing": "Active" })) {
return (
<ActiveDetourPanel
detourText="Hello World"
copyableDetourText="Hello World"
directions={extendedDirections}
connectionPoints={[
connectionPoints?.start?.name ?? "N/A",
Expand Down Expand Up @@ -391,7 +391,7 @@ export const DiversionPage = ({
} else if (snapshot.matches({ "Detour Drawing": "Past" })) {
return (
<PastDetourPanel
detourText="Hello World"
copyableDetourText="Hello World"
directions={extendedDirections}
connectionPoints={[
connectionPoints?.start?.name ?? "N/A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react"
import { ActiveDetourPanel } from "../../../src/components/detours/detourPanels/activeDetourPanel"
import { stopFactory } from "../../../tests/factories/stop"

const defaulText = [
const defaultText = [
"Detour:",
"66 Harvard via Allston from",
"Andrew Station",
Expand Down Expand Up @@ -34,7 +34,7 @@ const meta = {
stretch: true,
},
args: {
detourText: defaulText,
copyableDetourText: defaultText,
directions: [
{ instruction: "Start at Centre St & John St" },
{ instruction: "Right on John St" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const meta = {
stretch: true,
},
args: {
detourText: defaultText,
copyableDetourText: defaultText,
},
// The bootstrap CSS reset is supposed to set box-sizing: border-box by
// default, we should be able to remove this after that is added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react"
import { PastDetourPanel } from "../../../src/components/detours/detourPanels/pastDetourPanel"
import { stopFactory } from "../../../tests/factories/stop"

const defaulText = [
const defaultText = [
"Detour:",
"66 Harvard via Allston from",
"Andrew Station",
Expand Down Expand Up @@ -34,7 +34,7 @@ const meta = {
stretch: true,
},
args: {
detourText: defaulText,
copyableDetourText: defaultText,
directions: [
{ instruction: "Start at Centre St & John St" },
{ instruction: "Right on John St" },
Expand Down

0 comments on commit c9dc3b2

Please sign in to comment.