Skip to content

Instantly share code, notes, and snippets.

@jneumann
Created October 21, 2015 15:21
Show Gist options
  • Save jneumann/f9c483b9fccc4d9dd44e to your computer and use it in GitHub Desktop.
Save jneumann/f9c483b9fccc4d9dd44e to your computer and use it in GitHub Desktop.
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
View,
TabBarIOS,
Icon
} = React;
var {
TabBarIOS
} = require('react-native-icons');
class cwsFieldReporter extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedTab: 'view'
};
}
render() {
return (
<TabBarIOS selectedTab={this.state.selectedTab}>
<TabBarIOS.Item
select={this.state.selectedTab === 'view'}
title="See Reports"
onPress={() => {
this.setState({
selectedTab: 'view'
});
}}>
</TabBarIOS.Item>
<TabBarIOS.Item
select={this.state.selectedTab === 'submit'}
title="Create Report"
onPress={() => {
this.setState({
selectedTab: 'submit'
});
}}>
</TabBarIOS.Item>
</TabBarIOS>
);
}
};
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('cwsFieldReporter', () => cwsFieldReporter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment