// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import React from 'react'; import {Image, Navigator, StyleSheet, Text, TouchableOpacity} from 'react-native'; import SelectServerView from './select_server_view'; import menuImage from 'images/menu.png'; const styles = StyleSheet.create({ container: { flexDirection: 'row', flex: 1 }, button: { backgroundColor: 'white', padding: 15, borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: '#CDCDCD' }, buttonText: { fontSize: 17, fontWeight: '500' }, navBar: { backgroundColor: 'white', flexDirection: 'row' }, navBarText: { fontSize: 16, marginVertical: 10 }, navBarTitleText: { color: '#373E4D', fontWeight: '500', marginVertical: 9 }, navBarLeftButton: { paddingLeft: 10 }, navBarRightButton: { paddingRight: 10 }, navBarButtonText: { color: '#5890FF' }, activityIndicator: { alignItems: 'center', justifyContent: 'center', padding: 8, flex: 1 }, menuImage: { height: 30, width: 30 } }); const NavigationBarRouteMapper = { LeftButton(route, navigator, index, navState) { if (index === 0) { return null; } const previousRoute = navState.routeStack[index - 1]; if (previousRoute.signin) { return ( navigator.pop()} style={styles.navBarLeftButton} > ); } let title = null; if (previousRoute.root) { title = 'Server'; } else if (previousRoute.channels) { title = 'Channels'; } return ( navigator.pop()} style={styles.navBarLeftButton} > {'< ' + title} ); }, RightButton() { return null; }, Title(route) { return ( {route.title} ); } }; export default class RootNavigator extends React.Component { renderScene = (route, navigator) => { if (route.root) { return ( { navigator.push({signin: true}); }} /> ); } else if (route.signin) { // return ( // { // navigator.push({title: 'Team Selection', }); // }} // /> // ); } return null; } render() { return ( } /> ); } }