mirror of
https://github.com/jellyfin/jellyfin-expo.git
synced 2024-11-23 05:59:39 +00:00
Merge pull request #373 from thornbill/active-tab-icon
This commit is contained in:
commit
b9befe49aa
@ -19,16 +19,20 @@ import { getIconName } from '../utils/Icons';
|
||||
import HomeNavigator from './HomeNavigator';
|
||||
import SettingsNavigator from './SettingsNavigator';
|
||||
|
||||
function TabIcon(routeName, color, size) {
|
||||
function TabIcon(routeName, focused, color, size) {
|
||||
let iconName = null;
|
||||
if (routeName === Screens.HomeTab) {
|
||||
iconName = getIconName('tv-outline');
|
||||
iconName = getIconName('tv');
|
||||
} else if (routeName === Screens.DownloadsTab) {
|
||||
iconName = 'download-outline';
|
||||
iconName = 'download';
|
||||
} else if (routeName === Screens.SettingsTab) {
|
||||
iconName = getIconName('cog-outline');
|
||||
iconName = getIconName('cog');
|
||||
} else {
|
||||
iconName = 'help-circle-outline';
|
||||
iconName = 'help-circle';
|
||||
}
|
||||
|
||||
if (!focused) {
|
||||
iconName += '-outline';
|
||||
}
|
||||
|
||||
return (
|
||||
@ -58,7 +62,7 @@ const TabNavigator = observer(() => {
|
||||
<Tab.Navigator
|
||||
screenOptions={({ route }) => ({
|
||||
headerShown: false,
|
||||
tabBarIcon: ({ color, size }) => TabIcon(route.name, color, size),
|
||||
tabBarIcon: ({ focused, color, size }) => TabIcon(route.name, focused, color, size),
|
||||
tabBarInactiveTintColor: theme.colors.grey1,
|
||||
tabBarShowLabel: rootStore.settingStore.isTabLabelsEnabled,
|
||||
tabBarStyle
|
||||
|
Loading…
Reference in New Issue
Block a user