Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Fix links + edit copy #1437

Merged
merged 8 commits into from
Feb 19, 2020
5 changes: 2 additions & 3 deletions f2/src/PrivacyConsentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Stack } from '@chakra-ui/core'
import { useStateValue } from './utils/state'
import { A } from './components/link'
import { useLingui } from '@lingui/react'
import { Link } from './components/link'

export const PrivacyConsentPage = () => {
const { i18n } = useLingui()
Expand Down Expand Up @@ -57,9 +56,9 @@ export const PrivacyConsentPage = () => {
</P>
<P>
<Trans id="privacyConsentInfoPage.learnMore" />
<Link to="/privacystatement">
<A href="/privacystatement" isExternal>
<Trans id="privacyConsentInfoPage.linkOut" />
</Link>
</A>
<Trans id="privacyConsentInfoPage.period" />
</P>
<PrivacyConsentInfoForm
Expand Down
49 changes: 24 additions & 25 deletions f2/src/forms/FinalFeedbackForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { Button } from '../components/button'
import { RadioAdapter } from '../components/radio'
import { FormArrayControl } from '../components/FormArrayControl'


const Control = ({ name, ...rest }) => {
const {
meta: { error, touched },
Expand Down Expand Up @@ -90,44 +89,44 @@ export const FinalFeedbackForm = props => {
spacing={12}
>
<Control as="fieldset" name="wasServiceHard">
<FormArrayControl
name="wasServiceHard"
label={<Trans id="finalFeedback.wasServiceHard.label" />}
>
<Stack spacing={4}>
{wasServiceHard.map(key => {
return (
<Box key={key}>
<RadioAdapter
name="wasServiceHard"
value={key}
isChecked={wasServiceHard.includes(key)}
>
{i18n._(key)}
</RadioAdapter>
</Box>
)
})}
</Stack>
</FormArrayControl>
<FormArrayControl
name="wasServiceHard"
label={<Trans id="finalFeedback.wasServiceHard.label" />}
>
<Stack spacing={4}>
{wasServiceHard.map(key => {
return (
<Box key={key}>
<RadioAdapter
name="wasServiceHard"
value={key}
isChecked={wasServiceHard.includes(key)}
>
{i18n._(key)}
</RadioAdapter>
</Box>
)
})}
</Stack>
</FormArrayControl>
</Control>

<Control as="fieldset" name="wouldYouUseAgain">
<Stack spacing={4} shouldWrapChildren>
<FormArrayControl
name="wasServiceHard"
label={<Trans id="finalFeedback.wouldYouUseAgain.label" />}
name="wasServiceHard"
label={<Trans id="finalFeedback.wouldYouUseAgain.label" />}
>
<Stack spacing={4}>
{wouldYouUseAgain.map(key => {
{wouldYouUseAgain.map(key => {
return (
<Box key={key}>
<RadioAdapter
name="wouldYouUseAgain"
value={key}
isChecked={wouldYouUseAgain.includes(key)}
>
{i18n._(key)}
{i18n._(key)}
</RadioAdapter>
</Box>
)
Expand Down
3 changes: 1 addition & 2 deletions f2/src/forms/HowDidItStartForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { Form } from 'react-final-form'
import { NextAndCancelButtons } from '../components/next-and-cancel-buttons'
import { CheckboxAdapter } from '../components/checkbox'
import { RadioAdapter } from '../components/radio'
import { Stack, Box, Alert, AlertIcon} from '@chakra-ui/core'
import { Stack, Box, Alert, AlertIcon } from '@chakra-ui/core'
import { useStateValue } from '../utils/state'
import { FormArrayControl } from '../components/FormArrayControl'
import { Field } from '../components/Field'
import { TextArea } from '../components/text-area'


const validate = () => {
return {}
}
Expand Down
146 changes: 72 additions & 74 deletions f2/src/forms/InformationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Trans } from '@lingui/macro'
import { Form, Field, useField } from 'react-final-form'
import { NextAndCancelButtons } from '../components/next-and-cancel-buttons'
import { TextArea } from '../components/text-area'
import { Stack, FormControl, Alert, AlertIcon} from '@chakra-ui/core'
import { Stack, FormControl, Alert, AlertIcon } from '@chakra-ui/core'
import { FormHelperText } from '../components/FormHelperText'
import { FormLabel } from '../components/FormLabel'
import { useStateValue } from '../utils/state'
Expand Down Expand Up @@ -79,82 +79,80 @@ export const InformationForm = props => {
>
<Control as="fieldset" name="typeOfInfoReq">
<Stack spacing={4} shouldWrapChildren>
<FormArrayControl
name="infoReqOther"
label={<Trans id="informationPage.typeOfInfoReq" />}
helperText={<Trans id="informationPage.typeOfInfoReqExample" />}
<FormArrayControl
name="infoReqOther"
label={<Trans id="informationPage.typeOfInfoReq" />}
helperText={
<Trans id="informationPage.typeOfInfoReqExample" />
}
>
{typeOfInfoReq.map(key => {
return (
<React.Fragment key={key}>
<CheckboxAdapter
name="infoReqOther"
value={key}
>
{i18n._(key)}
</CheckboxAdapter>
{key === 'typeOfInfoReq.other' &&
values.typeOfInfoReq.includes(
'typeOfInfoReq.other',
) && (
<ConditionalForm>
<Field name="infoReqOther">
{props => (
<FormControl>
<FormLabel htmlFor={key}></FormLabel>
<TextInput
id="infoReqOther"
name={props.input.name}
value={props.input.value}
onChange={props.input.onChange}
/>
</FormControl>
)}
</Field>
</ConditionalForm>
)}
</React.Fragment>
)
})}
</FormArrayControl>
{typeOfInfoReq.map(key => {
return (
<React.Fragment key={key}>
<CheckboxAdapter name="infoReqOther" value={key}>
{i18n._(key)}
</CheckboxAdapter>
{key === 'typeOfInfoReq.other' &&
values.typeOfInfoReq.includes(
'typeOfInfoReq.other',
) && (
<ConditionalForm>
<Field name="infoReqOther">
{props => (
<FormControl>
<FormLabel htmlFor={key}></FormLabel>
<TextInput
id="infoReqOther"
name={props.input.name}
value={props.input.value}
onChange={props.input.onChange}
/>
</FormControl>
)}
</Field>
</ConditionalForm>
)}
</React.Fragment>
)
})}
</FormArrayControl>
</Stack>
</Control>
<Control as="fieldset" name="typeOfInfoObtained">
<Stack spacing={4} shouldWrapChildren>
<FormArrayControl
name="infoReqOther"
label={<Trans id="informationPage.typeOfInfoObtained" />}
helperText={<Trans id="informationPage.typeOfInfoObtainedExample" />}
>
helperText={
<Trans id="informationPage.typeOfInfoObtainedExample" />
}
>
{typeOfInfoObtained.map(key => {
return (
<React.Fragment key={key}>
<CheckboxAdapter
name="typeOfInfoObtained"
value={key}
>
{i18n._(key)}
<CheckboxAdapter name="typeOfInfoObtained" value={key}>
{i18n._(key)}
</CheckboxAdapter>
{key === 'typeOfInfoObtained.other' &&
values.typeOfInfoReq.includes(
'typeOfInfoObtained.other',
) && (
<ConditionalForm>
<Field name="typeOfInfoObtained">
{props => (
<FormControl>
<FormLabel htmlFor={key}></FormLabel>
<TextInput
id="typeOfInfoObtained"
name={props.input.name}
value={props.input.value}
onChange={props.input.onChange}
/>
</FormControl>
)}
</Field>
</ConditionalForm>
)}
values.typeOfInfoReq.includes(
'typeOfInfoObtained.other',
) && (
<ConditionalForm>
<Field name="typeOfInfoObtained">
{props => (
<FormControl>
<FormLabel htmlFor={key}></FormLabel>
<TextInput
id="typeOfInfoObtained"
name={props.input.name}
value={props.input.value}
onChange={props.input.onChange}
/>
</FormControl>
)}
</Field>
</ConditionalForm>
)}
</React.Fragment>
)
})}
Expand Down Expand Up @@ -194,18 +192,18 @@ export const InformationForm = props => {
<A
href={
i18n.locale === 'en'
? 'https://www.transunion.ca/'
: 'https://www.transunion.ca/fr'
? 'https://www.transunion.ca/'
: 'https://www.transunion.ca/fr'
}
isExternal // Opens new tab
/>
</Trans>
</Alert>
<NextAndCancelButtons
next={<Trans id="informationPage.nextStep" />}
button={<Trans id="informationPage.nextButton" />}
/>
</Stack>
/>
</Trans>
</Alert>
<NextAndCancelButtons
next={<Trans id="informationPage.nextStep" />}
button={<Trans id="informationPage.nextButton" />}
/>
</Stack>
)}
/>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion f2/src/forms/MidFeedbackForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const MidFeedbackForm = ({ onSubmit }) => {
value={key}
isChecked={midFeedback.includes(key)}
>
{i18n._(key)}
{i18n._(key)}
</CheckboxAdapter>
</Box>
)
Expand Down
8 changes: 2 additions & 6 deletions f2/src/forms/MoneyLostInfoForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { useStateValue } from '../utils/state'
import { ConditionalForm } from '../components/container'
import { CheckboxAdapter } from '../components/checkbox'


const Control = ({ name, ...rest }) => {
const {
meta: { error, touched },
Expand Down Expand Up @@ -112,11 +111,8 @@ export const MoneyLostInfoForm = props => {
{methodsOfPayment.map(key => {
return (
<Box key={key}>
<CheckboxAdapter
name="methodPayment"
value={key}
>
{i18n._(key)}
<CheckboxAdapter name="methodPayment" value={key}>
{i18n._(key)}
</CheckboxAdapter>
{key === 'methodPayment.other' &&
values.methodPayment.includes(
Expand Down
Loading