|
1 | | -import { BottomTabBarProps, createBottomTabNavigator } from '@react-navigation/bottom-tabs'; |
| 1 | +import { createNativeBottomTabNavigator } from '@bottom-tabs/react-navigation'; |
2 | 2 |
|
3 | 3 | import { ReceiveStackNavigator } from '@suite-native/module-receive'; |
4 | 4 | import { HomeStackNavigator } from '@suite-native/module-home'; |
5 | 5 | import { AccountsStackNavigator } from '@suite-native/module-accounts-management'; |
6 | 6 | import { SettingsStackNavigator } from '@suite-native/module-settings'; |
7 | | -import { AppTabsParamList, AppTabsRoutes, TabBar } from '@suite-native/navigation'; |
| 7 | +import { AppTabsRoutes } from '@suite-native/navigation'; |
8 | 8 | import { useHandleDeviceRequestsPassphrase } from '@suite-native/device-authorization'; |
| 9 | +import { useNativeStyles } from '@trezor/styles'; |
| 10 | +import { useTranslate } from '@suite-native/intl'; |
9 | 11 |
|
10 | | -import { rootTabsOptions } from './routes'; |
11 | | - |
12 | | -const Tab = createBottomTabNavigator<AppTabsParamList>(); |
| 12 | +const Tab = createNativeBottomTabNavigator(); |
13 | 13 |
|
14 | 14 | export const AppTabNavigator = () => { |
15 | 15 | useHandleDeviceRequestsPassphrase(); |
| 16 | + const { utils } = useNativeStyles(); |
| 17 | + const { translate } = useTranslate(); |
16 | 18 |
|
17 | 19 | return ( |
18 | 20 | <Tab.Navigator |
19 | 21 | initialRouteName={AppTabsRoutes.HomeStack} |
20 | | - screenOptions={{ |
21 | | - headerShown: false, |
22 | | - unmountOnBlur: true, |
| 22 | + tabLabelStyle={{ |
| 23 | + fontFamily: utils.typography.label.fontFamily, |
| 24 | + fontSize: utils.typography.label.fontSize, |
23 | 25 | }} |
24 | | - tabBar={(props: BottomTabBarProps) => ( |
25 | | - <TabBar tabItemOptions={rootTabsOptions} {...props} /> |
26 | | - )} |
| 26 | + barTintColor={utils.colors.backgroundSurfaceElevation0} |
| 27 | + tabBarActiveTintColor={utils.colors.iconPrimaryDefault} |
| 28 | + activeIndicatorColor={utils.colors.backgroundNeutralDisabled} |
| 29 | + tabBarInactiveTintColor={utils.colors.iconDisabled} |
| 30 | + // disable page animations because it looks strange with device switcher |
| 31 | + // we should try to move device switcher outside of navigator |
| 32 | + disablePageAnimations |
| 33 | + labeled |
27 | 34 | > |
28 | | - <Tab.Screen name={AppTabsRoutes.HomeStack} component={HomeStackNavigator} /> |
29 | | - <Tab.Screen name={AppTabsRoutes.AccountsStack} component={AccountsStackNavigator} /> |
30 | | - <Tab.Screen name={AppTabsRoutes.ReceiveStack} component={ReceiveStackNavigator} /> |
31 | | - <Tab.Screen name={AppTabsRoutes.SettingsStack} component={SettingsStackNavigator} /> |
| 35 | + <Tab.Screen |
| 36 | + name={AppTabsRoutes.HomeStack} |
| 37 | + component={HomeStackNavigator} |
| 38 | + options={{ |
| 39 | + tabBarIcon: () => require('@suite-common/icons/assets/house.svg'), |
| 40 | + tabBarLabel: translate('tabBar.home'), |
| 41 | + }} |
| 42 | + /> |
| 43 | + <Tab.Screen |
| 44 | + name={AppTabsRoutes.AccountsStack} |
| 45 | + component={AccountsStackNavigator} |
| 46 | + options={{ |
| 47 | + tabBarIcon: () => require('@suite-common/icons/assets/discover.svg'), |
| 48 | + tabBarLabel: translate('tabBar.accounts'), |
| 49 | + }} |
| 50 | + /> |
| 51 | + <Tab.Screen |
| 52 | + name={AppTabsRoutes.ReceiveStack} |
| 53 | + component={ReceiveStackNavigator} |
| 54 | + options={{ |
| 55 | + tabBarIcon: () => require('@suite-common/icons/assets/arrowLineDown.svg'), |
| 56 | + tabBarLabel: translate('tabBar.receive'), |
| 57 | + }} |
| 58 | + /> |
| 59 | + <Tab.Screen |
| 60 | + name={AppTabsRoutes.SettingsStack} |
| 61 | + component={SettingsStackNavigator} |
| 62 | + options={{ |
| 63 | + tabBarIcon: () => require('@suite-common/icons/assets/gear.svg'), |
| 64 | + tabBarLabel: translate('tabBar.settings'), |
| 65 | + }} |
| 66 | + /> |
32 | 67 | </Tab.Navigator> |
33 | 68 | ); |
34 | 69 | }; |
0 commit comments