Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@franzejr
Last active July 7, 2016 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franzejr/c6e31908292b990f7d40d191ead95314 to your computer and use it in GitHub Desktop.
Save franzejr/c6e31908292b990f7d40d191ead95314 to your computer and use it in GitHub Desktop.
TabView
import React, { PropTypes } from 'react';
import { StyleSheet, View } from 'react-native';
import Button from 'react-native-button';
import { Actions } from 'react-native-router-flux';
const contextTypes = {
drawer: React.PropTypes.object,
};
const propTypes = {
name: PropTypes.string,
sceneStyle: View.propTypes.style,
title: PropTypes.string,
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF',
alignItems: 'stretch',
justifyContent: 'center',
borderWidth: 1,
},
});
const TabView = (props, context) => {
const drawer = context.drawer;
return (
<View style={[styles.container, props.sceneStyle]}>
<Button onPress={() => { drawer.close(); Actions.mainScreen(); }}>Home</Button>
<Button onPress={() => { drawer.close(); Actions.settingsScreen(); }}>SettingScreen</Button>
<Button onPress={() => { drawer.close(); Actions.loginScreen(); }}>Login Screen</Button>
</View>
);
};
TabView.contextTypes = contextTypes;
TabView.propTypes = propTypes;
module.exports = TabView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment