Last active
July 7, 2016 13:02
-
-
Save franzejr/c6e31908292b990f7d40d191ead95314 to your computer and use it in GitHub Desktop.
TabView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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