From 7994c55d41dec5ad495ef61b2cf337f34e242f6c Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:21:05 -0600 Subject: [PATCH] Revert "fix: find external TOS link by locale" This reverts commit 18036c376a424c11d84af7567d1376f46be5fc16. --- lib/app.js | 7 ++----- lib/components/user/terms-of-use-pane.tsx | 13 ++++--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/app.js b/lib/app.js index f87976fdf..4e3fb6728 100644 --- a/lib/app.js +++ b/lib/app.js @@ -68,8 +68,7 @@ const { MobileResultsScreen, MobileSearchScreen, ModeIcon, - RouteRenderer, - termsOfUseI18n + RouteRenderer } = jsConfig const requiredComponents = { @@ -188,9 +187,7 @@ const components = { TermsOfService, - TermsOfStorage, - - termsOfUseI18n + TermsOfStorage } const Webapp = () => ( diff --git a/lib/components/user/terms-of-use-pane.tsx b/lib/components/user/terms-of-use-pane.tsx index a6d706d89..561d84bbe 100644 --- a/lib/components/user/terms-of-use-pane.tsx +++ b/lib/components/user/terms-of-use-pane.tsx @@ -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, @@ -17,25 +16,21 @@ const TermsOfUsePane = ({ disableCheckTerms, handleBlur, handleChange, - locale, + termsOfServiceLink, values: userData }: { disableCheckTerms: boolean handleBlur: () => void handleChange: FormEventHandler - 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 ( @@ -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 } }