Skip to content

Commit

Permalink
Merge branch 'master-trip-form-update' of https://github.com/opentrip…
Browse files Browse the repository at this point in the history
…planner/otp-react-redux into master-trip-form-update
  • Loading branch information
amy-corson-ibigroup committed Sep 18, 2024
2 parents f389d34 + ddda7fb commit c9606d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/components/form/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react'

import { getFormattedMode } from '../../util/i18n'
import { hasValidLocation } from '../../util/state'
import { QueryParamChangeHandler } from '../util/types'
import { RoutingQueryCallResult } from '../../actions/api-constants'
import { updateQueryTimeIfLeavingNow } from '../../actions/form'

Expand Down Expand Up @@ -52,13 +53,14 @@ export const addCustomSettingLabels =
* @param params Params to store
*/
export const onSettingsUpdate =
(setQueryParam: (evt: any) => void) => (params: any) => {
(setQueryParam: QueryParamChangeHandler) =>
(params: any): void => {
setQueryParam({ queryParamData: params, ...params })
}

export const setModeButton =
(enabledModeButtons: string[], updateHandler: (params: any) => void) =>
(buttonId: string, newState: boolean) => {
(buttonId: string, newState: boolean): void => {
let newButtons
if (newState) {
newButtons = [...enabledModeButtons, buttonId]
Expand Down
2 changes: 2 additions & 0 deletions lib/components/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ export type ZoomToPlaceHandler = (
place?: { lat: number; lon: number },
zoom?: number
) => void

export type QueryParamChangeHandler = (event: any) => void

0 comments on commit c9606d9

Please sign in to comment.