// @flow import * as React from 'react'; import {createDrawerNavigator} from '@react-navigation/drawer'; import TabNavigator 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 AvailableRoomScreen from "../screens/Websites/AvailableRoomScreen"; import BibScreen from "../screens/Websites/BibScreen"; import DebugScreen from '../screens/About/DebugScreen'; import Sidebar from "../components/Sidebar"; import {createStackNavigator, TransitionPresets} from "@react-navigation/stack"; import HeaderButton from "../components/HeaderButton"; import i18n from "i18n-js"; const defaultScreenOptions = { gestureEnabled: true, cardOverlayEnabled: true, ...TransitionPresets.SlideFromRightIOS, }; function getDrawerButton(navigation: Object) { return ( ); } const AboutStack = createStackNavigator(); function AboutStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.about'), headerLeft: openDrawer }; }} /> ); } const SettingsStack = createStackNavigator(); function SettingsStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.settings'), headerLeft: openDrawer }; }} /> ); } const SelfMenuStack = createStackNavigator(); function SelfMenuStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.menuSelf'), headerLeft: openDrawer }; }} /> ); } const AvailableRoomStack = createStackNavigator(); function AvailableRoomStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.availableRooms'), headerLeft: openDrawer }; }} /> ); } const BibStack = createStackNavigator(); function BibStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.bib'), headerLeft: openDrawer }; }} /> ); } const Drawer = createDrawerNavigator(); function getDrawerContent(props) { return } export default function DrawerNavigator() { return ( getDrawerContent(props)} screenOptions={defaultScreenOptions} > ); }