diff options
author | Eric Bailey <git@esb.lol> | 2024-01-30 17:04:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 15:04:54 -0800 |
commit | bb7ce215f7d141ddefe6f259439d1169db46d594 (patch) | |
tree | 32597661cd71e2339b1ba75fbf6d1e131ef6feeb /src/screens/Onboarding/StepInterests/index.tsx | |
parent | 4058174678e68a7536e772382be5f8f2a2b6e556 (diff) | |
download | voidsky-bb7ce215f7d141ddefe6f259439d1169db46d594.tar.zst |
i18n interests, allow for fallbacks (#2692)
Diffstat (limited to 'src/screens/Onboarding/StepInterests/index.tsx')
-rw-r--r-- | src/screens/Onboarding/StepInterests/index.tsx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/screens/Onboarding/StepInterests/index.tsx b/src/screens/Onboarding/StepInterests/index.tsx index 6f60991d5..5440dcd2b 100644 --- a/src/screens/Onboarding/StepInterests/index.tsx +++ b/src/screens/Onboarding/StepInterests/index.tsx @@ -17,17 +17,14 @@ import {getAgent} from '#/state/session' import {useAnalytics} from '#/lib/analytics/analytics' import {Text} from '#/components/Typography' import {useOnboardingDispatch} from '#/state/shell' +import {capitalize} from '#/lib/strings/capitalize' -import {Context} from '#/screens/Onboarding/state' +import {Context, ApiResponseMap} from '#/screens/Onboarding/state' import { Title, Description, OnboardingControls, } from '#/screens/Onboarding/Layout' -import { - ApiResponseMap, - INTEREST_TO_DISPLAY_NAME, -} from '#/screens/Onboarding/StepInterests/data' import {InterestButton} from '#/screens/Onboarding/StepInterests/InterestButton' import {IconCircle} from '#/screens/Onboarding/IconCircle' @@ -36,7 +33,7 @@ export function StepInterests() { const t = useTheme() const {track} = useAnalytics() const {gtMobile} = useBreakpoints() - const {state, dispatch} = React.useContext(Context) + const {state, dispatch, interestsDisplayNames} = React.useContext(Context) const [saving, setSaving] = React.useState(false) const [interests, setInterests] = React.useState<string[]>( state.interestsStepResults.selectedInterests.map(i => i), @@ -202,7 +199,9 @@ export function StepInterests() { <Toggle.Item key={interest} name={interest} - label={INTEREST_TO_DISPLAY_NAME[interest]}> + label={ + interestsDisplayNames[interest] || capitalize(interest) + }> <InterestButton interest={interest} /> </Toggle.Item> ))} |