about summary refs log tree commit diff
path: root/src/screens/Onboarding/StepInterests/InterestButton.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-01-30 17:04:54 -0600
committerGitHub <noreply@github.com>2024-01-30 15:04:54 -0800
commitbb7ce215f7d141ddefe6f259439d1169db46d594 (patch)
tree32597661cd71e2339b1ba75fbf6d1e131ef6feeb /src/screens/Onboarding/StepInterests/InterestButton.tsx
parent4058174678e68a7536e772382be5f8f2a2b6e556 (diff)
downloadvoidsky-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.tsx6
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>
   )