// @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 TetrisScreen from "../screens/Tetris/TetrisScreen"; 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"; import LoginScreen from "../screens/Amicale/LoginScreen"; import ProfileScreen from "../screens/Amicale/ProfileScreen"; 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 TetrisStack = createStackNavigator(); function TetrisStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t("game.title"), headerLeft: openDrawer }; }} /> ); } const LoginStack = createStackNavigator(); function LoginStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.login'), headerLeft: openDrawer }; }} /> ); } const ProfileStack = createStackNavigator(); function ProfileStackComponent() { return ( { const openDrawer = getDrawerButton.bind(this, navigation); return { title: i18n.t('screens.profile'), headerLeft: openDrawer }; }} /> ); } const Drawer = createDrawerNavigator(); function getDrawerContent(props) { return } export default function DrawerNavigator() { return ( getDrawerContent(props)} screenOptions={defaultScreenOptions} > ); }