@@ -11,9 +11,11 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
1111import Ionicon from 'react-native-vector-icons/Ionicons'
1212import SimpleLineIcons from 'react-native-vector-icons/SimpleLineIcons'
1313
14+ import { getCountryCodeByIp } from '../../actions/AccountReferralActions'
1415import { writeDefaultScreen } from '../../actions/DeviceSettingsActions'
1516import { Fontello } from '../../assets/vector/index'
1617import { ENV } from '../../env'
18+ import { useAsyncEffect } from '../../hooks/useAsyncEffect'
1719import { useHandler } from '../../hooks/useHandler'
1820import { LocaleStringKey } from '../../locales/en_US'
1921import { lstrings } from '../../locales/strings'
@@ -44,6 +46,7 @@ const title: { readonly [key: string]: string } = {
4446 homeTab : lstrings . title_home ,
4547 walletsTab : lstrings . title_assets ,
4648 buyTab : lstrings . title_buy ,
49+ buyTabAlt : lstrings . loan_fragment_deposit ,
4750 sellTab : lstrings . title_sell ,
4851 swapTab : lstrings . title_exchange ,
4952 extraTab : lstrings [ extraTabString ] ,
@@ -187,6 +190,17 @@ const Tab = ({
187190 const theme = useTheme ( )
188191 const insets = useSafeAreaInsets ( )
189192 const color = isActive ? theme . tabBarIconHighlighted : theme . tabBarIcon
193+ const [ countryCode , setCountryCode ] = React . useState < string | undefined > ( )
194+
195+ // Set countryCode once
196+ useAsyncEffect (
197+ async ( ) => {
198+ const countryCode = await getCountryCodeByIp ( ) . catch ( ( ) => '' )
199+ setCountryCode ( countryCode )
200+ } ,
201+ [ ] ,
202+ 'countryCode'
203+ )
190204
191205 const icon : { readonly [ key : string ] : JSX . Element } = {
192206 homeTab : < SimpleLineIcons name = "home" size = { theme . rem ( 1.25 ) } color = { color } /> ,
@@ -227,7 +241,7 @@ const Tab = ({
227241 < TabContainer accessible = { false } insetBottom = { insets . bottom } key = { route . key } onPress = { handleOnPress } >
228242 { icon [ route . name ] }
229243 < Label accessible numberOfLines = { 1 } adjustsFontSizeToFit minimumFontScale = { 0.65 } isActive = { isActive } openRatio = { footerOpenRatio } >
230- { title [ route . name ] }
244+ { route . name === 'buyTab' && countryCode === 'GB' ? title . buyTabAlt : title [ route . name ] }
231245 </ Label >
232246 </ TabContainer >
233247 )
0 commit comments