2019-08-07 10:24:35 +02:00
|
|
|
import * as React from 'react';
|
2020-03-05 10:29:15 +01:00
|
|
|
import {createStackNavigator, TransitionPresets} from '@react-navigation/stack';
|
|
|
|
import {createMaterialBottomTabNavigator} from "@react-navigation/material-bottom-tabs";
|
2019-08-07 10:24:35 +02:00
|
|
|
|
|
|
|
import HomeScreen from '../screens/HomeScreen';
|
|
|
|
import PlanningScreen from '../screens/PlanningScreen';
|
2020-02-04 14:42:19 +01:00
|
|
|
import PlanningDisplayScreen from '../screens/PlanningDisplayScreen';
|
2019-09-28 12:01:19 +02:00
|
|
|
import ProxiwashScreen from '../screens/Proxiwash/ProxiwashScreen';
|
2020-02-03 12:17:59 +01:00
|
|
|
import ProxiwashAboutScreen from '../screens/Proxiwash/ProxiwashAboutScreen';
|
2019-08-07 10:24:35 +02:00
|
|
|
import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen';
|
2020-02-03 12:17:59 +01:00
|
|
|
import ProximoListScreen from "../screens/Proximo/ProximoListScreen";
|
|
|
|
import ProximoAboutScreen from "../screens/Proximo/ProximoAboutScreen";
|
2020-01-30 17:42:11 +01:00
|
|
|
import PlanexScreen from '../screens/Websites/PlanexScreen';
|
2019-08-07 10:24:35 +02:00
|
|
|
import CustomMaterialIcon from "../components/CustomMaterialIcon";
|
2019-08-07 11:33:45 +02:00
|
|
|
import ThemeManager from "../utils/ThemeManager";
|
2020-03-05 10:29:15 +01:00
|
|
|
import AboutScreen from "../screens/About/AboutScreen";
|
|
|
|
import AboutDependenciesScreen from "../screens/About/AboutDependenciesScreen";
|
|
|
|
import DebugScreen from "../screens/DebugScreen";
|
|
|
|
import SettingsScreen from "../screens/SettingsScreen";
|
|
|
|
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',
|
|
|
|
};
|
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
const ProximoStack = createStackNavigator();
|
|
|
|
|
|
|
|
function ProximoStackComponent() {
|
|
|
|
return (
|
|
|
|
<ProximoStack.Navigator
|
|
|
|
initialRouteName="ProximoMainScreen"
|
|
|
|
mode='card'
|
|
|
|
headerMode="none"
|
|
|
|
screenOptions={{
|
|
|
|
gestureEnabled: true,
|
|
|
|
cardOverlayEnabled: true,
|
|
|
|
...TransitionPresets.SlideFromRightIOS,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<ProximoStack.Screen
|
|
|
|
name="ProximoMainScreen"
|
|
|
|
component={ProximoMainScreen}
|
|
|
|
/>
|
|
|
|
<ProximoStack.Screen
|
|
|
|
name="ProximoListScreen"
|
|
|
|
component={ProximoListScreen}
|
|
|
|
/>
|
|
|
|
<ProximoStack.Screen
|
|
|
|
name="ProximoAboutScreen"
|
|
|
|
component={ProximoAboutScreen}
|
|
|
|
options={{
|
|
|
|
...TransitionPresets.ModalSlideFromBottomIOS,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</ProximoStack.Navigator>
|
|
|
|
);
|
|
|
|
}
|
2020-02-03 12:17:59 +01:00
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
const ProxiwashStack = createStackNavigator();
|
2020-02-03 12:17:59 +01:00
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
function ProxiwashStackComponent() {
|
|
|
|
return (
|
|
|
|
<ProxiwashStack.Navigator
|
|
|
|
initialRouteName="ProxiwashScreen"
|
|
|
|
mode='card'
|
|
|
|
headerMode="none"
|
|
|
|
screenOptions={{
|
|
|
|
gestureEnabled: true,
|
|
|
|
cardOverlayEnabled: true,
|
|
|
|
...TransitionPresets.ModalSlideFromBottomIOS,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<ProxiwashStack.Screen
|
|
|
|
name="ProxiwashScreen"
|
|
|
|
component={ProxiwashScreen}
|
|
|
|
/>
|
|
|
|
<ProxiwashStack.Screen
|
|
|
|
name="ProxiwashAboutScreen"
|
|
|
|
component={ProxiwashAboutScreen}
|
|
|
|
/>
|
|
|
|
</ProxiwashStack.Navigator>
|
|
|
|
);
|
|
|
|
}
|
2020-02-04 14:42:19 +01:00
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
const PlanningStack = createStackNavigator();
|
2020-02-04 14:42:19 +01:00
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
function PlanningStackComponent() {
|
|
|
|
return (
|
|
|
|
<PlanningStack.Navigator
|
|
|
|
initialRouteName="PlanningScreen"
|
|
|
|
mode='card'
|
|
|
|
headerMode="none"
|
|
|
|
screenOptions={{
|
|
|
|
gestureEnabled: true,
|
|
|
|
cardOverlayEnabled: true,
|
|
|
|
...TransitionPresets.ModalSlideFromBottomIOS,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<PlanningStack.Screen
|
|
|
|
name="PlanningScreen"
|
|
|
|
component={PlanningScreen}
|
|
|
|
/>
|
|
|
|
<PlanningStack.Screen
|
|
|
|
name="PlanningDisplayScreen"
|
|
|
|
component={PlanningDisplayScreen}
|
|
|
|
/>
|
|
|
|
</PlanningStack.Navigator>
|
|
|
|
);
|
2019-09-12 23:02:28 +02:00
|
|
|
}
|
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
const HomeStack = createStackNavigator();
|
2019-09-12 23:02:28 +02:00
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
function HomeStackComponent() {
|
|
|
|
return (
|
|
|
|
<HomeStack.Navigator
|
|
|
|
initialRouteName="HomeScreen"
|
|
|
|
mode='card'
|
|
|
|
headerMode="none"
|
|
|
|
screenOptions={{
|
|
|
|
gestureEnabled: true,
|
|
|
|
cardOverlayEnabled: true,
|
|
|
|
...TransitionPresets.ModalSlideFromBottomIOS,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<HomeStack.Screen
|
|
|
|
name="HomeScreen"
|
|
|
|
component={HomeScreen}
|
|
|
|
/>
|
|
|
|
<HomeStack.Screen
|
|
|
|
name="PlanningDisplayScreen"
|
|
|
|
component={PlanningDisplayScreen}
|
|
|
|
/>
|
|
|
|
</HomeStack.Navigator>
|
|
|
|
);
|
|
|
|
}
|
2019-08-07 10:24:35 +02:00
|
|
|
|
2020-03-05 10:29:15 +01:00
|
|
|
const Tab = createMaterialBottomTabNavigator();
|
|
|
|
|
|
|
|
export default function TabNavigator() {
|
|
|
|
return (
|
|
|
|
<Tab.Navigator
|
|
|
|
initialRouteName={AsyncStorageManager.getInstance().preferences.defaultStartScreen}
|
|
|
|
barStyle={{backgroundColor: ThemeManager.getCurrentThemeVariables().brandPrimary}}
|
|
|
|
screenOptions={({ route }) => ({
|
|
|
|
tabBarIcon: ({ focused, color, size }) => {
|
|
|
|
let icon = TAB_ICONS[route.name];
|
|
|
|
// tintColor is ignoring activeColor and inactiveColor for some reason
|
|
|
|
color = focused ? "#f0edf6" : "#4e1108";
|
|
|
|
return <CustomMaterialIcon icon={icon} color={color}/>;
|
|
|
|
},
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
<Tab.Screen
|
|
|
|
name="Proximo"
|
|
|
|
component={ProximoStackComponent}
|
|
|
|
/>
|
|
|
|
<Tab.Screen
|
|
|
|
name="Planning"
|
|
|
|
component={PlanningStackComponent}
|
|
|
|
/>
|
|
|
|
<Tab.Screen
|
|
|
|
name="Home"
|
|
|
|
component={HomeStackComponent}
|
|
|
|
/>
|
|
|
|
<Tab.Screen
|
|
|
|
name="Proxiwash"
|
|
|
|
component={ProxiwashStackComponent}
|
|
|
|
/>
|
|
|
|
<Tab.Screen
|
|
|
|
name="Planex"
|
|
|
|
component={PlanexScreen}
|
|
|
|
/>
|
|
|
|
</Tab.Navigator>
|
|
|
|
);
|
|
|
|
}
|