2020-02-03 12:17:59 +01:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { createDrawerNavigator } from 'react-navigation-drawer';
|
|
|
|
import {createMaterialBottomTabNavigatorWithInitialRoute} from './MainTabNavigator';
|
|
|
|
import SettingsScreen from '../screens/SettingsScreen';
|
|
|
|
import AboutScreen from '../screens/About/AboutScreen';
|
|
|
|
import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen';
|
|
|
|
import SelfMenuScreen from '../screens/SelfMenuScreen';
|
|
|
|
import TutorInsaScreen from "../screens/Websites/TutorInsaScreen";
|
|
|
|
import AmicaleScreen from "../screens/Websites/AmicaleScreen";
|
|
|
|
import WiketudScreen from "../screens/Websites/WiketudScreen";
|
|
|
|
import ElusEtudScreen from "../screens/Websites/ElusEtudScreen";
|
|
|
|
import BlueMindScreen from "../screens/Websites/BlueMindScreen";
|
|
|
|
import EntScreen from "../screens/Websites/EntScreen";
|
|
|
|
import AvailableRoomScreen from "../screens/Websites/AvailableRoomScreen";
|
|
|
|
import DebugScreen from '../screens/DebugScreen';
|
|
|
|
import Sidebar from "../components/Sidebar";
|
2020-02-04 12:23:32 +01:00
|
|
|
import {createStackNavigator, TransitionPresets} from "react-navigation-stack";
|
2020-02-03 12:17:59 +01:00
|
|
|
|
|
|
|
const AboutStack = createStackNavigator({
|
|
|
|
AboutScreen: {screen: AboutScreen},
|
|
|
|
AboutDependenciesScreen: {screen: AboutDependenciesScreen},
|
|
|
|
DebugScreen: {screen: DebugScreen},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
initialRouteName: "AboutScreen",
|
|
|
|
mode: 'card',
|
|
|
|
headerMode: "none",
|
2020-02-04 12:23:32 +01:00
|
|
|
defaultNavigationOptions: {
|
|
|
|
gestureEnabled: true,
|
|
|
|
cardOverlayEnabled: true,
|
|
|
|
...TransitionPresets.SlideFromRightIOS,
|
|
|
|
},
|
2020-02-03 12:17:59 +01:00
|
|
|
});
|
|
|
|
|
2020-02-04 19:42:40 +01:00
|
|
|
|
|
|
|
// Create a stack to use animations
|
|
|
|
function createDrawerStackWithInitialRoute(initialRoute: string) {
|
|
|
|
return createStackNavigator({
|
|
|
|
Main: createMaterialBottomTabNavigatorWithInitialRoute(initialRoute),
|
|
|
|
SettingsScreen: {screen: SettingsScreen},
|
|
|
|
AboutScreen: AboutStack,
|
|
|
|
SelfMenuScreen: {screen: SelfMenuScreen},
|
|
|
|
TutorInsaScreen: {screen: TutorInsaScreen},
|
|
|
|
AmicaleScreen: {screen: AmicaleScreen},
|
|
|
|
WiketudScreen: {screen: WiketudScreen},
|
|
|
|
ElusEtudScreen: {screen: ElusEtudScreen},
|
|
|
|
BlueMindScreen: {screen: BlueMindScreen},
|
|
|
|
EntScreen: {screen: EntScreen},
|
|
|
|
AvailableRoomScreen: {screen: AvailableRoomScreen},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
initialRouteName: "Main",
|
|
|
|
mode: 'card',
|
|
|
|
headerMode: "none",
|
|
|
|
defaultNavigationOptions: {
|
|
|
|
gestureEnabled: true,
|
|
|
|
cardOverlayEnabled: true,
|
|
|
|
...TransitionPresets.SlideFromRightIOS,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-02-03 12:17:59 +01:00
|
|
|
/**
|
|
|
|
* Creates the drawer navigation stack
|
|
|
|
*/
|
|
|
|
function createDrawerNavigatorWithInitialRoute(initialRoute: string) {
|
|
|
|
return createDrawerNavigator({
|
2020-02-04 19:42:40 +01:00
|
|
|
Main: createDrawerStackWithInitialRoute(initialRoute),
|
2020-02-03 12:17:59 +01:00
|
|
|
}, {
|
|
|
|
contentComponent: Sidebar,
|
|
|
|
initialRouteName: 'Main',
|
|
|
|
backBehavior: 'initialRoute',
|
|
|
|
drawerType: 'front',
|
|
|
|
useNativeAnimations: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export {createDrawerNavigatorWithInitialRoute};
|