import { Platform } from 'react-native' ; import { NavigationScreenRouteConfig } from 'react-navigation' ; import { createBottomTabNavigator } from 'react-navigation-tabs' ; import { getTheme } from '@frogpond/app-theme' ; import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs' ; type ComponentType = ( screens : { [ key ] : NavigationScreenRouteConfig ; } , options : any ) => typeof createTabNavigator ; const createTabNavigator = Platform . OS === 'android' ? createMaterialBottomTabNavigator : createBottomTabNavigator ; export const TabNavigator = ( screens , options = { } ) => { const theme = getTheme ( ) ; return createTabNavigator ( screens , { backBehavior : 'none' , activeColor : theme . androidTabBarForeground , theme : { colors : { primary : theme . androidTabBarBackground } , } , ... options , defaultNavigationOptions : { ... ( options . defaultNavigationOptions || { } ) , } , tabBarOptions : { activeColor : theme . iosTabBarActiveColor , ... ( options . tabBarOptions || { } ) , labelStyle : { fontFamily : 'System' , } , } , } ) ; } ;