-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Change detour duration modal (#2928)
* feat: Add change duration button, icon, and user group * feat: set up UI flow, add editedSelectedDuration to state machine * test: build out editedDuration test suite
- Loading branch information
1 parent
8afe772
commit bb0fc04
Showing
9 changed files
with
376 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react" | ||
import { Form } from "react-bootstrap" | ||
import { possibleDurations, SurroundingModal } from "./activateDetourModal" | ||
|
||
const ChangingDuration = ({ | ||
onSelectDuration, | ||
selectedDuration, | ||
editedSelectedDuration, | ||
}: { | ||
onSelectDuration: (duration: string) => void | ||
selectedDuration?: string | ||
editedSelectedDuration?: string | ||
}) => ( | ||
<> | ||
<span className="mb-4"> | ||
<span className="fw-bold">Previous time length</span>{" "} | ||
<span>(estimate)</span> | ||
<p className="mt-2" data-testid="change-detour-duration-previous-time"> | ||
{selectedDuration} | ||
</p> | ||
</span> | ||
<p> | ||
<span className="fw-bold">New time length</span> <span>(estimate)</span> | ||
</p> | ||
<Form> | ||
{possibleDurations.map((duration) => ( | ||
<Form.Check | ||
className="mb-2" | ||
onChange={() => { | ||
onSelectDuration(duration) | ||
}} | ||
id={`duration-${duration}`} | ||
key={`duration-${duration}`} | ||
type="radio" | ||
label={duration} | ||
checked={editedSelectedDuration === duration} | ||
/> | ||
))} | ||
</Form> | ||
</> | ||
) | ||
|
||
export const ChangeDuration = { | ||
Modal: SurroundingModal, | ||
Body: ChangingDuration, | ||
} |
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
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
Oops, something went wrong.