2017-08-09 16:19:17 +00:00
|
|
|
import React from 'react';
|
2017-08-09 17:14:50 +00:00
|
|
|
import { Button, Platform } from 'react-native';
|
2017-08-03 18:23:43 +00:00
|
|
|
import { StackNavigator } from 'react-navigation';
|
2017-08-09 01:40:55 +00:00
|
|
|
import LoginView from './views/login';
|
|
|
|
import NewServerView from './views/serverNew';
|
|
|
|
import ListServerView from './views/serverList';
|
2017-08-11 19:57:09 +00:00
|
|
|
import Main from './views/Main';
|
2017-08-09 01:40:55 +00:00
|
|
|
import RoomsListView from './views/roomsList';
|
|
|
|
import RoomView from './views/room';
|
2017-08-10 16:25:50 +00:00
|
|
|
import CreateChannel from './views/CreateChannel';
|
2017-08-03 18:23:43 +00:00
|
|
|
|
2017-08-09 17:14:50 +00:00
|
|
|
|
2017-08-09 16:19:17 +00:00
|
|
|
const MainCardNavigator = StackNavigator({
|
2017-08-11 19:57:09 +00:00
|
|
|
Main: {
|
|
|
|
screen: Main
|
|
|
|
},
|
2017-08-09 16:19:17 +00:00
|
|
|
Rooms: {
|
2017-08-11 17:05:30 +00:00
|
|
|
screen: RoomsListView
|
2017-08-07 00:34:35 +00:00
|
|
|
},
|
|
|
|
Room: {
|
|
|
|
screen: RoomView
|
2017-08-11 19:57:09 +00:00
|
|
|
},
|
|
|
|
ListServerModal: {
|
|
|
|
screen: ListServerView,
|
|
|
|
navigationOptions: ({ navigation }) =>
|
|
|
|
(Platform.OS === 'ios' ? ({
|
|
|
|
headerLeft: Platform.OS === 'ios' && (<Button title='Close' onPress={() => navigation.dispatch({ type: 'Navigation/BACK' })} />)
|
|
|
|
}) : {})
|
2017-08-07 00:34:35 +00:00
|
|
|
}
|
2017-08-03 18:23:43 +00:00
|
|
|
}, {
|
2017-08-11 19:57:09 +00:00
|
|
|
initialRouteName: 'Main',
|
2017-08-03 18:23:43 +00:00
|
|
|
cardStyle: {
|
|
|
|
backgroundColor: '#fff'
|
|
|
|
}
|
|
|
|
});
|
2017-08-09 16:19:17 +00:00
|
|
|
|
|
|
|
export default new StackNavigator({
|
|
|
|
Main: {
|
|
|
|
screen: MainCardNavigator,
|
|
|
|
navigationOptions: {
|
|
|
|
header: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
Login: {
|
|
|
|
screen: LoginView,
|
|
|
|
navigationOptions: ({ navigation }) => ({
|
2017-08-09 17:14:50 +00:00
|
|
|
headerLeft: Platform.OS === 'ios' && (<Button title='Cancel' onPress={() => navigation.dispatch({ type: 'Navigation/BACK' })} />)
|
2017-08-09 16:19:17 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
NewServerModal: {
|
|
|
|
screen: NewServerView,
|
|
|
|
navigationOptions: ({ navigation }) => ({
|
2017-08-09 17:14:50 +00:00
|
|
|
headerLeft: Platform.OS === 'ios' && (<Button title='Close' onPress={() => navigation.dispatch({ type: 'Navigation/BACK' })} />)
|
2017-08-09 16:19:17 +00:00
|
|
|
})
|
2017-08-10 16:25:50 +00:00
|
|
|
},
|
|
|
|
CreateChannel: {
|
|
|
|
screen: CreateChannel,
|
|
|
|
navigationOptions: ({ navigation }) => ({
|
|
|
|
headerLeft: Platform.OS === 'ios' && (<Button title='Cancel' onPress={() => navigation.dispatch({ type: 'Navigation/BACK' })} />)
|
|
|
|
})
|
2017-08-09 16:19:17 +00:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
initialRouteName: 'Main',
|
|
|
|
cardStyle: {
|
|
|
|
backgroundColor: '#fff'
|
2017-08-11 18:18:09 +00:00
|
|
|
}
|
|
|
|
// mode: 'modal'
|
2017-08-09 16:19:17 +00:00
|
|
|
});
|