tegarkurniawan

Main.js

Sep 10th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import {
  3. StyleSheet,
  4. Text,
  5. View
  6. } from 'react-native';
  7. import {Actions, Scene, Router, Switch, Modal} from 'react-native-router-flux';
  8. import About from './scenes/About';
  9. import Question from './scenes/Question';
  10.  
  11. class TabIcon extends Component {
  12. render(){
  13. const title = this.props.title;
  14. return (
  15. <Text>{title}</Text>
  16. );
  17. }
  18. }
  19. class Main extends Component {
  20. componentWillMount() {
  21. this.scenes = Actions.create(
  22. <Scene key="root" tabs={true}>
  23. <Scene key="tabbar" tabs={true} tabBarStyle={{backgroundColor:'#f7f7f7'}}>
  24. <Scene key="Questions" component={Question} title="Questions" icon={TabIcon} hideNavBar={true}/>
  25. <Scene key="About" component={About} title="About" icon={TabIcon} hideNavBar={true}/>
  26. </Scene>
  27. </Scene>
  28. );
  29. }
  30. render() {
  31. return <Router scenes={this.scenes}/>
  32. }
  33. }
  34.  
  35. module.exports = Main;
Advertisement
Add Comment
Please, Sign In to add comment