@@ -13,7 +13,7 @@ import {
1313 createNativeStackNavigator ,
1414 NativeStackNavigationProp
1515} from '@react-navigation/native-stack'
16- import { createBottomTabNavigator } from '@react-navigation/bottom -tabs'
16+ import { createMaterialTopTabNavigator } from '@react-navigation/material-top -tabs'
1717
1818import useAsyncStorage from './helpers/useAsyncStorage'
1919import useJsonAsyncStorage from './helpers/useJsonAsyncStorage'
@@ -28,7 +28,7 @@ import SettingScreen from './screens/settings/SettingScreen'
2828import globalStyle from './globalStyle'
2929
3030const Stacks = createNativeStackNavigator ( )
31- const Tabs = createBottomTabNavigator ( )
31+ const Tabs = createMaterialTopTabNavigator ( ) // createBottomTabNavigator()
3232
3333type HomeNavigationProp = NativeStackNavigationProp <
3434 { Home : undefined ; Chat : undefined } ,
@@ -42,11 +42,11 @@ const HomeScreen = ({ navigation }: { navigation: HomeNavigationProp }) => {
4242 } , [ connection , navigation ] )
4343
4444 return (
45- // LOW-TODO: Swipe between tab screens.
4645 < Tabs . Navigator
46+ tabBarPosition = 'bottom'
4747 screenOptions = { ( { route } ) => ( {
4848 // eslint-disable-next-line react/prop-types,react/display-name
49- tabBarIcon : ( { focused, color, size } ) => {
49+ tabBarIcon : ( { focused, color } ) => {
5050 let Component = Ionicons
5151 let iconName = focused ? 'ios-list-circle' : 'ios-list'
5252 switch ( route . name ) {
@@ -62,9 +62,11 @@ const HomeScreen = ({ navigation }: { navigation: HomeNavigationProp }) => {
6262 default :
6363 break
6464 }
65- return < Component name = { iconName } size = { size } color = { color } />
65+ return < Component name = { iconName } size = { 24 } color = { color } />
6666 } ,
6767 tabBarLabelStyle : { marginBottom : 5 } ,
68+ tabBarActiveTintColor : '#007AFF' ,
69+ tabBarInactiveTintColor : '#a0a0a0' ,
6870 headerShown : false
6971 } ) }
7072 >
0 commit comments