diff --git a/lib/components/user/terms-of-use-pane.tsx b/lib/components/user/terms-of-use-pane.tsx index 469c7bf2e..7054f4a84 100644 --- a/lib/components/user/terms-of-use-pane.tsx +++ b/lib/components/user/terms-of-use-pane.tsx @@ -3,6 +3,7 @@ import { connect } from 'react-redux' import { FormattedMessage, useIntl } from 'react-intl' import React, { FormEventHandler } from 'react' +import { AppReduxState } from '../../util/state-types' import { LinkOpensNewWindow } from '../util/externalLink' import { TERMS_OF_SERVICE_PATH, @@ -24,7 +25,7 @@ const TermsOfUsePane = ({ handleBlur: () => void handleChange: FormEventHandler locale: string - termsOfServiceLink: string + termsOfServiceLink?: string values: { hasConsentedToTerms: boolean storeTripHistory: boolean @@ -101,7 +102,7 @@ const TermsOfUsePane = ({ ) } -const mapStateToProps = (state: any) => { +const mapStateToProps = (state: AppReduxState) => { return { locale: state.otp.ui?.locale, termsOfServiceLink: state.otp.config.termsOfServiceLink, diff --git a/lib/util/config-types.ts b/lib/util/config-types.ts index a0d46c3d1..6b980bbf0 100644 --- a/lib/util/config-types.ts +++ b/lib/util/config-types.ts @@ -103,7 +103,9 @@ export type PersistenceConfig = ( | LocalPersistenceConfig | MiddlewarePersistenceConfig ) & { - enabled?: boolean + enabled?: boolean | undefined + // eslint-disable-next-line camelcase + terms_of_storage?: boolean | undefined } /** Popup target settings */ @@ -370,6 +372,8 @@ export interface AppConfig { /** Whether to show the x minutes late/early in the itinerary body */ showScheduleDeviation?: boolean stopViewer?: StopViewerConfig + /** Externally hosted terms of service URL */ + termsOfServiceLink?: string /** App title shown in the browser title bar. */ title?: string transitOperators?: TransitOperatorConfig[]