import React from 'react'; | |
import { Dimensions, AsyncStorage } from 'react-native'; | |
import { Provider } from 'react-redux'; | |
import { call, put, takeEvery, select } from 'redux-saga/effects' | |
// Navigation | |
import { createStackNavigator, createDrawerNavigator, DrawerActions } from 'react-navigation' | |
// Get store (redux) | |
import store from './store' | |
// Scenes | |
import Splash from './scenes/Splash' | |
import EntranceLogin from './scenes/Entrance/scenes/Login' | |
import Schedule from './scenes/Schedule' | |
import Historic from './scenes/Historic' | |
import UserChangePassword from './scenes/User/scenes/ChangePassword' | |
import UserChangePhoto from './scenes/User/scenes/ChangePhoto' | |
import CheckinSendPhoto from './scenes/CheckinSendPhoto' | |
import OrderService from './scenes/OrderService' | |
import OrderServiceDetails from './scenes/OrderService/scenes/Details' | |
import OrderServiceExecution from './scenes/OrderService/scenes/Execution' | |
import Measurer from './scenes/Measurer' | |
import MeasurerRating from './scenes/Measurer/scenes/Rating' | |
// Components | |
import ContentAccountDrawer from '@components/ContentAccountDrawer' | |
const RootStack = createStackNavigator( | |
{ | |
Splash: { screen: Splash }, | |
EntranceLogin: { screen: EntranceLogin }, | |
Schedule: { screen: Schedule }, | |
Historic: { screen: Historic }, | |
UserChangePassword: { screen: UserChangePassword }, | |
UserChangePhoto: { screen: UserChangePhoto }, | |
CheckinSendPhoto: { screen: CheckinSendPhoto }, | |
OrderService: { screen: OrderService }, | |
OrderServiceDetails: { screen: OrderServiceDetails }, | |
OrderServiceExecution: { screen: OrderServiceExecution }, | |
Measurer: { screen: Measurer }, | |
MeasurerRating: { screen: MeasurerRating } | |
}, | |
{ | |
initialRouteName: 'Schedule', | |
headerMode: 'none', | |
navigationOptions: { | |
gesturesEnabled: false | |
} | |
} | |
) | |
const AccountDrawer = createDrawerNavigator( | |
{ RootStack }, | |
{ | |
initialRouteName: 'RootStack', | |
headerMode: 'none', | |
drawerPosition: 'left', | |
drawerBackgroundColor: '#fff', | |
contentComponent: ContentAccountDrawer, | |
drawerWidth: 300, | |
drawerLockMode: 'locked-closed', | |
getCustomActionCreators: (route, stateKey) => ({ | |
toggleAccountDrawer: () => DrawerActions.toggleDrawer({ key: stateKey }) | |
}) | |
} | |
) | |
const App = createStackNavigator( | |
{ | |
Stack: { screen: AccountDrawer } | |
}, | |
{ | |
headerMode: 'none' | |
} | |
) | |
const STORE = store(App) | |
export default class RootApp extends React.Component { | |
render () { | |
return ( | |
<Provider store={STORE.store}> | |
<React.Fragment> | |
<STORE.AppWithNavigationState /> | |
</React.Fragment> | |
</Provider> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment