Skip to content

Commit

Permalink
wip! make invalid state show up on error
Browse files Browse the repository at this point in the history
  • Loading branch information
firestack committed Nov 4, 2024
1 parent 9f030d9 commit df88720
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 7 additions & 3 deletions assets/src/components/detours/activateDetourModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const SurroundingModal = ({
) : (
<Button
variant="primary"
disabled={onNext === undefined}
className={onNext ? "" : "disabled"}
onClick={onNext}
data-fs-element={nextStepLabel}
>
Expand Down Expand Up @@ -112,7 +112,7 @@ const SelectingDuration = ({
<p>
<span className="fw-bold">Time length</span> <span>(estimate)</span>
</p>
<Form noValidate validated>
<Form noValidate>
<Form.Group>
{possibleDurations.map((duration) => (
<Form.Check
Expand All @@ -125,9 +125,13 @@ const SelectingDuration = ({
type="radio"
label={duration}
checked={selectedDuration === duration}
isInvalid={isError}
/>
))}
<Form.Control.Feedback type="invalid">
<Form.Control.Feedback
type="invalid"
className={isError ? "d-block" : ""}
>
Time length is required
</Form.Control.Feedback>
</Form.Group>
Expand Down
9 changes: 9 additions & 0 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,15 @@ export const DiversionPage = ({
duration: selectedDuration,
})
}}
isError={snapshot.matches({
"Detour Drawing": {
"Share Detour": {
Activating: {
"Selecting Duration": "No Duration Selected - Error",
},
},
},
})}
selectedDuration={selectedDuration}
/>
) : snapshot.matches({
Expand Down

0 comments on commit df88720

Please sign in to comment.