Skip to content

Commit

Permalink
Revert "fix: find external TOS link by locale"
Browse files Browse the repository at this point in the history
This reverts commit 18036c3.
  • Loading branch information
amy-corson-ibigroup committed Dec 4, 2023
1 parent aef963a commit 7994c55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
7 changes: 2 additions & 5 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ const {
MobileResultsScreen,
MobileSearchScreen,
ModeIcon,
RouteRenderer,
termsOfUseI18n
RouteRenderer
} = jsConfig

const requiredComponents = {
Expand Down Expand Up @@ -188,9 +187,7 @@ const components = {

TermsOfService,

TermsOfStorage,

termsOfUseI18n
TermsOfStorage
}

const Webapp = () => (
Expand Down
13 changes: 4 additions & 9 deletions lib/components/user/terms-of-use-pane.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Checkbox, ControlLabel, FormGroup } from 'react-bootstrap'
import { connect } from 'react-redux'
import { FormattedMessage, useIntl } from 'react-intl'
import React, { FormEventHandler, useContext } from 'react'
import React, { FormEventHandler } from 'react'

import { ComponentContext } from '../../util/contexts'
import { LinkOpensNewWindow } from '../util/externalLink'
import {
TERMS_OF_SERVICE_PATH,
Expand All @@ -17,25 +16,21 @@ const TermsOfUsePane = ({
disableCheckTerms,
handleBlur,
handleChange,
locale,
termsOfServiceLink,
values: userData
}: {
disableCheckTerms: boolean
handleBlur: () => void
handleChange: FormEventHandler<Checkbox>
locale: string
termsOfServiceLink: string
values: {
hasConsentedToTerms: boolean
storeTripHistory: boolean
}
}) => {
const intl = useIntl()

// @ts-expect-error no type on ComponentContext
const { termsOfUseI18n } = useContext(ComponentContext)
const { hasConsentedToTerms, storeTripHistory } = userData

const termsOfServiceLink = termsOfUseI18n(locale)
const termsURL = termsOfServiceLink || `/#${TERMS_OF_SERVICE_PATH}`

return (
Expand Down Expand Up @@ -104,7 +99,7 @@ const TermsOfUsePane = ({
}
const mapStateToProps = (state: any) => {
return {
locale: state.otp.ui?.locale,
termsOfServiceLink: state.otp.config.termsOfServiceLink,
termsOfStorageSet: state.otp.config.persistence?.terms_of_storage
}
}
Expand Down

0 comments on commit 7994c55

Please sign in to comment.