fix tab labels

This commit is contained in:
austinried 2021-07-28 09:42:39 +09:00
parent c58f860520
commit d486fb9782
3 changed files with 8 additions and 8 deletions

View File

@ -93,7 +93,7 @@ const BottomTabBar: React.FC<BottomTabBarProps> = ({ state, descriptors, navigat
label={label}
name={route.name}
isFocused={state.index === index}
img={icons[options.icon]}
img={icons[route.name]}
navigation={navigation}
/>
)

View File

@ -107,10 +107,10 @@ const Tab = createBottomTabNavigator()
const BottomTabNavigator = () => {
return (
<Tab.Navigator tabBar={BottomTabBar} initialRouteName="home">
<Tab.Screen name="home" component={HomeTab} options={{ icon: 'home' } as any} />
<Tab.Screen name="library" component={LibraryTab} options={{ icon: 'library' } as any} />
<Tab.Screen name="search" component={SearchTab} options={{ icon: 'search' } as any} />
<Tab.Screen name="settings" component={SettingsView} options={{ icon: 'settings' } as any} />
<Tab.Screen name="home" component={HomeTab} options={{ tabBarLabel: 'Home' }} />
<Tab.Screen name="library" component={LibraryTab} options={{ tabBarLabel: 'Library' }} />
<Tab.Screen name="search" component={SearchTab} options={{ tabBarLabel: 'Search' }} />
<Tab.Screen name="settings" component={SettingsView} options={{ tabBarLabel: 'Settings' }} />
</Tab.Navigator>
)
}

View File

@ -18,9 +18,9 @@ const LibraryTopTabNavigator = () => (
indicatorStyle: styles.tabindicatorStyle,
}}
initialRouteName="albums">
<Tab.Screen name="albums" component={AlbumsTab} />
<Tab.Screen name="artists" component={ArtistsTab} />
<Tab.Screen name="playlists" component={PlaylistsTab} />
<Tab.Screen name="albums" component={AlbumsTab} options={{ tabBarLabel: 'Albums' }} />
<Tab.Screen name="artists" component={ArtistsTab} options={{ tabBarLabel: 'Artists' }} />
<Tab.Screen name="playlists" component={PlaylistsTab} options={{ tabBarLabel: 'Playlists' }} />
</Tab.Navigator>
)