2019-08-07 10:24:35 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
import {createMaterialBottomTabNavigator} from "react-navigation-material-bottom-tabs";
|
|
|
|
|
|
|
|
import HomeScreen from '../screens/HomeScreen';
|
|
|
|
import PlanningScreen from '../screens/PlanningScreen';
|
|
|
|
import ProxiwashScreen from '../screens/ProxiwashScreen';
|
|
|
|
import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen';
|
|
|
|
import PlanexScreen from '../screens/PlanexScreen';
|
|
|
|
import CustomMaterialIcon from "../components/CustomMaterialIcon";
|
2019-08-07 11:33:45 +02:00
|
|
|
import ThemeManager from "../utils/ThemeManager";
|
2019-09-12 23:02:28 +02:00
|
|
|
import AsyncStorageManager from "../utils/AsyncStorageManager";
|
2019-08-07 10:24:35 +02:00
|
|
|
|
|
|
|
const TAB_ICONS = {
|
2019-08-20 19:15:24 +02:00
|
|
|
Home: 'triangle',
|
2019-08-07 10:24:35 +02:00
|
|
|
Planning: 'calendar-range',
|
|
|
|
Proxiwash: 'washing-machine',
|
|
|
|
Proximo: 'shopping',
|
|
|
|
Planex: 'timetable',
|
|
|
|
};
|
|
|
|
|
2019-09-12 23:02:28 +02:00
|
|
|
function createMaterialBottomTabNavigatorWithInitialRoute(initialRoute: string) {
|
|
|
|
return createMaterialBottomTabNavigator({
|
|
|
|
Home: {screen: HomeScreen},
|
|
|
|
Planning: {screen: PlanningScreen,},
|
|
|
|
Proxiwash: {screen: ProxiwashScreen,},
|
|
|
|
Proximo: {screen: ProximoMainScreen,},
|
|
|
|
Planex: {screen: PlanexScreen},
|
|
|
|
}, {
|
|
|
|
defaultNavigationOptions: ({navigation}) => ({
|
|
|
|
tabBarIcon: ({focused, horizontal, tintColor}) => {
|
|
|
|
let icon = TAB_ICONS[navigation.state.routeName];
|
2019-08-07 10:24:35 +02:00
|
|
|
|
2019-09-12 23:02:28 +02:00
|
|
|
return <CustomMaterialIcon icon={icon} color={tintColor}/>;
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
order: ['Proximo', 'Planning', 'Home', 'Proxiwash', 'Planex'],
|
|
|
|
initialRouteName: initialRoute,
|
|
|
|
activeColor: '#f0edf6',
|
|
|
|
inactiveColor: '#4e1108',
|
|
|
|
backBehavior: 'initialRoute',
|
|
|
|
barStyle: {backgroundColor: ThemeManager.getCurrentThemeVariables().brandPrimary},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export {createMaterialBottomTabNavigatorWithInitialRoute};
|
2019-08-07 10:24:35 +02:00
|
|
|
|