Skip to content

Commit

Permalink
Merge branch 'dev' into trusted-companions
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-willis-arcadis authored Oct 23, 2024
2 parents b7ef0af + cab7c04 commit 186b634
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/components/form/advanced-settings-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ const AdvancedSettingsPanel = ({
)
)

const handleModeButtonToggle = setModeButton(
enabledModeButtons,
onSettingsUpdate(setQueryParam)
)

const handleAllSubmodesDisabled = (modeButton: ModeButtonDefinition) => {
handleModeButtonToggle(modeButton.key, false)
}

const onSaveAndReturnClick = useCallback(async () => {
await setCloseAdvancedSettingsWithDelay()
setClosingBySave(true)
Expand Down Expand Up @@ -221,11 +230,9 @@ const AdvancedSettingsPanel = ({
id: 'components.BatchSearchScreen.submodeSelectorLabel'
})}
modeButtons={processedModeButtons}
onAllSubmodesDisabled={handleAllSubmodesDisabled}
onSettingsUpdate={onSettingsUpdate(setQueryParam)}
onToggleModeButton={setModeButton(
enabledModeButtons,
onSettingsUpdate(setQueryParam)
)}
onToggleModeButton={handleModeButtonToggle}
/>
{saveAndReturnButton && (
<ReturnToTripPlanButton
Expand Down

0 comments on commit 186b634

Please sign in to comment.