/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, { Component } from 'react';
import { AsyncStorage } from 'react-native';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import Storage from 'react-native-storage';
import MainActivity from './pages/MainActivity';
import SchoolAge from './pages/SchoolAge';
import MainPage from './pages/components/MainPage';
import SchedulePage from './pages/components/SchedulePage';
import PersonalInfo from './pages/PersonalInfo';
import CourseDetails from './pages/CourseDetails';
import userCenter from './pages/userCenter';
import Order from './pages/buy/order';
import Ticket from './pages/buy/ticket';
import Buy from './pages/buy/buy';
import Login from './pages/Login';
import SearchResult from './pages/searchResult';
import PhoneBind from './pages/PhoneBind';
import Splash from './pages/Splash';
import './pages/components/RootView';

const RootNavigator = createStackNavigator(
	{
		MainActivity: { screen: MainActivity },
		SchoolAge: { screen: SchoolAge },
		MainPage: { screen: MainPage },
		SchedulePage: { screen: SchedulePage },
		PersonalInfo: { screen: PersonalInfo },
		userCenter: { screen: userCenter },
		CourseDetails: { screen: CourseDetails },
		Order: { screen: Order },
		Ticket: { screen: Ticket },
		Login: { screen: Login },
		Buy: { screen: Buy },
		SearchResult: { screen: SearchResult },
		PhoneBind: { screen: PhoneBind },
		Splash: { screen: Splash }
	},
	{
		initialRouteName: 'Splash',
		headerMode: 'null'
	}
);
const App = createAppContainer(RootNavigator);
export default App;

let storage = new Storage({
	size: 1000,
	storageBackend: AsyncStorage,
	defaultExpires: null,
	enableCache: true
});

global.storage = storage;