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/InterestButton.tsx | |
parent | 4058174678e68a7536e772382be5f8f2a2b6e556 (diff) | |
download | voidsky-bb7ce215f7d141ddefe6f259439d1169db46d594.tar.zst |
i18n interests, allow for fallbacks (#2692)
Diffstat (limited to 'src/screens/Onboarding/StepInterests/InterestButton.tsx')
-rw-r--r-- | src/screens/Onboarding/StepInterests/InterestButton.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/screens/Onboarding/StepInterests/InterestButton.tsx b/src/screens/Onboarding/StepInterests/InterestButton.tsx index 02413b18d..cc692dafd 100644 --- a/src/screens/Onboarding/StepInterests/InterestButton.tsx +++ b/src/screens/Onboarding/StepInterests/InterestButton.tsx @@ -4,11 +4,13 @@ import {View, ViewStyle, TextStyle} from 'react-native' import {useTheme, atoms as a, native} from '#/alf' import * as Toggle from '#/components/forms/Toggle' import {Text} from '#/components/Typography' +import {capitalize} from '#/lib/strings/capitalize' -import {INTEREST_TO_DISPLAY_NAME} from '#/screens/Onboarding/StepInterests/data' +import {Context} from '#/screens/Onboarding/state' export function InterestButton({interest}: {interest: string}) { const t = useTheme() + const {interestsDisplayNames} = React.useContext(Context) const ctx = Toggle.useItemContext() const styles = React.useMemo(() => { @@ -72,7 +74,7 @@ export function InterestButton({interest}: {interest: string}) { native({paddingTop: 2}), ctx.selected ? styles.textSelected : {}, ]}> - {INTEREST_TO_DISPLAY_NAME[interest]} + {interestsDisplayNames[interest] || capitalize(interest)} </Text> </View> ) |