import React from 'react';
import { createDrawerNavigator } from 'react-navigation-drawer';
import { createStackNavigator } from 'react-navigation-stack';
import { createAppContainer } from 'react-navigation';
import ProfileScreen from '../../containers/App/Profile/ProfileScreen';
import NewBookReqScreen from '../../containers/App/BookRequestList/NewBookRequest';
import SearchBookScreen from '../../containers/App/SearchBook/SearchBookScreen';
import ChangePasswordScreen from '../../containers/App/ChangePassword/ChangePasswordScreen';
import CustomComponent from './CustomComponent';

import BookHistoryscreen from '../../containers/App/BookHistory/BookHistoryScreen';
import styles from './Styles/customStyle';

export interface Props {
  navigation: any;
  navigationProps: any;
}

interface State {
  selected?: any;
  status?: boolean;
}

const StackNavigator = createStackNavigator(
  {
    Profile: ProfileScreen,
    SearchBook: SearchBookScreen,
    NewBook: NewBookReqScreen,
    ChangePassword: ChangePasswordScreen,
    BookHistory: BookHistoryscreen
  },
  {
    headerMode: 'none',
    initialRouteName: 'SearchBook',
    navigationOptions: {
      gesturesEnabled: true,
      backBehavior: 'initialRoute'
    }
  }
);
const AppNavigator = createDrawerNavigator(
  {
    Profile: {
      screen: StackNavigator
    },
    SearchBook: {
      screen: StackNavigator
    },
    NewBook: {
      screen: StackNavigator
    },
    ChangePassword: {
      screen: StackNavigator
    },
    BookHistory: {
      screen: StackNavigator
    }
  },
  {
    contentComponent: props => <CustomComponent {...props} />,
    drawerWidth: styles.$drawerWidth
  }
);
export default createAppContainer(AppNavigator);
