diff --git a/i18n/en-US.yml b/i18n/en-US.yml index 3faa3cca6..83fcfe7a7 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -329,6 +329,40 @@ components: timeWalking: "{time} walking" MobileOptions: header: Set Search Options + MobilityProfile: + DevicesPane: + devices: + cane: Cane + crutches: Crutches + electric wheelchair: Electric wheelchair + manual walker: Manual walker + manual wheelchair: Manual/traditional wheelchair + mobility scooter: Mobility scooter + none: No assistive device + service animal: Service animal + stroller: Stroller + wheeled walker: Wheeled walker + white cane: White cane + prompt: Do you regularly use a mobility assistive device? (Check all that apply) + LimitationsPane: + mobilityPrompt: >- + Do you have any mobility limitations that cause you to walk more slowly + or more carefully than other people? + visionLimitations: + legally-blind: Legally blind + low-vision: Low-vision + none: None + visionPrompt: Do you have any vision limitations? + MobilityPane: + button: Edit your mobility profile + header: Mobility Profile + mobilityDevices: "Mobility devices: " + mobilityLimitations: "Mobility limitations: " + visionLimitations: "Vision limitations: " + intro: >- + Please answer a few questions to customize the trip planning experience to + your needs and preferences. + title: Define Your Mobility Profile NarrativeItinerariesHeader: changeSortDir: Change sort direction howToFindResults: To view results, see the Itineraries Found heading below. diff --git a/i18n/fr.yml b/i18n/fr.yml index 7b94eac4e..a6fbbc818 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -346,6 +346,42 @@ components: timeWalking: "{time} de marche" MobileOptions: header: Options de recherche + MobilityProfile: + DevicesPane: + devices: + cane: Canne + crutches: Béquilles + electric wheelchair: Fauteuil roulant électrique + manual walker: Déambulateur manuel + manual wheelchair: Fauteuil roulant manuel + mobility scooter: Scooter électrique + none: Aucun + service animal: Animal de service + stroller: Poussette + wheeled walker: Déambulateur à roues + white cane: Canne blanche + prompt: >- + Utilisez-vous habituellement l'aide d'un appareil pour vous déplacer ? + (Cochez tous les cas qui vous concernent) + LimitationsPane: + mobilityPrompt: >- + Avez-vous des handicaps moteurs qui vous font marcher plus lentement ou + plus prudemment que d'autres personnes ? + visionLimitations: + legally-blind: Non-voyant + low-vision: Vision basse + none: Aucune + visionPrompt: Avez-vous des handicaps visuels ? + MobilityPane: + button: Modifier votre profil mobilité + header: Profil mobilité + mobilityDevices: "Appareils d'aide : " + mobilityLimitations: "Handicaps moteurs : " + visionLimitations: "Handicaps visuels : " + intro: >- + Veuillez répondre a quelques questions pour personaliser vos recherches de + trajets selon vos besoins et préférences. + title: Spécifiez votre profil de mobilité NarrativeItinerariesHeader: changeSortDir: Changer l'ordre de tri howToFindResults: Pour afficher les résultats, utilisez l'en-tête Trajets trouvés plus bas. diff --git a/i18n/i18n-exceptions.json b/i18n/i18n-exceptions.json index 0f3bd1185..9cb9f516a 100644 --- a/i18n/i18n-exceptions.json +++ b/i18n/i18n-exceptions.json @@ -33,6 +33,24 @@ "components.OTP2ErrorRenderer.inputFields.*": [ "FROM", "TO" + ], + "components.MobilityProfile.DevicesPane.devices.*": [ + "cane", + "crutches", + "electric wheelchair", + "manual walker", + "manual wheelchair", + "mobility scooter", + "none", + "service animal", + "stroller", + "wheeled walker", + "white cane" + ], + "components.MobilityProfile.LimitationsPane.visionLimitations.*": [ + "none", + "low-vision", + "legally-blind" ] } } \ No newline at end of file diff --git a/lib/components/user/common/dropdown-options.tsx b/lib/components/user/common/dropdown-options.tsx new file mode 100644 index 000000000..42ef7524f --- /dev/null +++ b/lib/components/user/common/dropdown-options.tsx @@ -0,0 +1,140 @@ +import { Field } from 'formik' +import { FormControl } from 'react-bootstrap' +import { IntlShape, useIntl } from 'react-intl' +import React, { ChangeEventHandler, ComponentType, ReactNode } from 'react' + +interface SelectProps { + Control?: ComponentType + children: ReactNode + defaultValue?: string | number | boolean + label?: ReactNode + name: string + onChange?: ChangeEventHandler +} + +/** + * A label followed by a dropdown control. + */ +export const Select = ({ + Control = FormControl, + children, + defaultValue, + label, + name, + onChange +}: SelectProps): JSX.Element => ( + // is kept outside of