From 937a709241f3e8a57a9690e1ffee615b68cd1b52 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:37:40 -0500 Subject: [PATCH 01/42] refactor(user/types): Add MobilityProfile type. --- lib/components/user/types.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/components/user/types.ts b/lib/components/user/types.ts index 187e3c586..b6418f830 100644 --- a/lib/components/user/types.ts +++ b/lib/components/user/types.ts @@ -14,6 +14,12 @@ export interface UserSavedLocation { type?: string } +export interface MobilityProfile { + isMobilityLimited: boolean + mobilityDevices: string[] + visionLimitation: 'none' | 'low-vision' | 'legally-blind' +} + /** * Type definition for an OTP-middleware (OTP-personas) user. */ @@ -24,6 +30,7 @@ export interface User { hasConsentedToTerms?: boolean id?: string isPhoneNumberVerified?: boolean + mobilityProfile?: MobilityProfile notificationChannel?: string phoneNumber?: string pushDevices?: number From 96c2681bada0d32690f8c1f445628177115e7d64 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:57:12 -0500 Subject: [PATCH 02/42] refactor(dropdown-options): Extract common components. --- .../user/common/dropdown-options.tsx | 121 +++++++++++++++++ .../trip-notifications-pane.tsx | 126 ++---------------- 2 files changed, 129 insertions(+), 118 deletions(-) create mode 100644 lib/components/user/common/dropdown-options.tsx diff --git a/lib/components/user/common/dropdown-options.tsx b/lib/components/user/common/dropdown-options.tsx new file mode 100644 index 000000000..a7b4a74c7 --- /dev/null +++ b/lib/components/user/common/dropdown-options.tsx @@ -0,0 +1,121 @@ +import { Field } from 'formik' +import React from 'react' + +/** + * A label followed by a dropdown control. + */ +export const Select = ({ + Control = FormControl, + children, + label, + name +}: { + // Note the prop order required by typescript-sort-keys, also applied above. + Control?: ComponentType + children: ReactNode + label?: ReactNode + name: string +}): JSX.Element => ( + // is kept outside of