Skip to content

Commit

Permalink
filter onboarding choices based for individual signups
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiceli committed Sep 26, 2024
1 parent c17d7c1 commit 80536b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, ro

const theme = useTheme();
const [onboardingErrorMessage, onboardingErrorMessageResult] = useOnyx(ONYXKEYS.ONBOARDING_ERROR_MESSAGE);
const customChoices = useOnyx(ONYXKEYS.ONBOARDING_CUSTOM_CHOICES)[0] || [];

Check failure on line 48 in src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator

Check failure on line 48 in src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator

const onboardingChoices = customChoices.length > 0

Check failure on line 50 in src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

Replace `·customChoices.length·>·0⏎····?·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES).filter(choice·=>·customChoices.includes(choice))⏎····:·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES)` with `⏎········customChoices.length·>·0·?·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES).filter((choice)·=>·customChoices.includes(choice))·:·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES);`

Check failure on line 50 in src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Replace `·customChoices.length·>·0⏎····?·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES).filter(choice·=>·customChoices.includes(choice))⏎····:·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES)` with `⏎········customChoices.length·>·0·?·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES).filter((choice)·=>·customChoices.includes(choice))·:·Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES);`
? Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES).filter(choice => customChoices.includes(choice))
: Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES)

const maxHeight = shouldEnableMaxHeight ? windowHeight : undefined;
const paddingHorizontal = onboardingIsMediumOrLargerScreenWidth ? styles.ph8 : styles.ph5;

const menuItems: MenuItemProps[] = Object.values(CONST.SELECTABLE_ONBOARDING_CHOICES).map((choice) => {
const menuItems: MenuItemProps[] = onboardingChoices.map((choice) => {
const translationKey = `onboarding.purpose.${choice}` as const;
return {
key: translationKey,
Expand Down

0 comments on commit 80536b4

Please sign in to comment.