Advertisement
lariciamota

Untitled

May 24th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { StyleSheet, Text, View, Button } from 'react-native';
  3. import { createStackNavigator, createBottomTabNavigator, createMaterialTopNavigator, createSwitchNavigator } from 'react-navigation'
  4.  
  5. class Intro extends React.Component{
  6.   render(){
  7.     return (
  8.       <View style={styles.container}>
  9.         <Button
  10.           onPress = {() => this.props.navigation.navigate('Rules')}
  11.           title = '?'
  12.         />
  13.         <Text>Pitch Voice</Text>
  14.         <Button
  15.           onPress = {() => this.props.navigation.navigate('PreGame')}
  16.           title = 'Novo Jogo'
  17.         />
  18.        
  19.       </View>
  20.     );
  21.   }
  22. }
  23.  
  24. class Rules extends React.Component{
  25.   render(){
  26.     return (
  27.       <View style={styles.container}>
  28.         <Text>Regras do Jogo</Text>
  29.       </View>
  30.     );
  31.   }
  32. }
  33.  
  34. class PreGame extends React.Component{
  35.   render(){
  36.     return (
  37.       <View style={styles.container}>
  38.         <Text>Pré partida</Text>
  39.         <Button
  40.         onPress = {() => this.props.navigation.navigate('Game')}
  41.         title = 'Jogar'
  42.         />
  43.       </View>
  44.     );
  45.   }
  46. }
  47.  
  48. class Game extends React.Component{
  49.   render(){
  50.     return (
  51.       <View style={styles.container}>
  52.         <Text>Partida</Text>
  53.         <Button
  54.         onPress = {() => this.props.navigation.navigate('Ranking')}
  55.         title = 'Pontuação'
  56.         />
  57.       </View>
  58.     );
  59.   }
  60. }
  61.  
  62. class Ranking extends React.Component{
  63.   render(){
  64.     return (
  65.       <View style={styles.container}>
  66.         <Text> Search Screen Top</Text>
  67.       </View>
  68.     );
  69.   }b
  70. }
  71.  
  72. const IntroStack = createStackNavigator({
  73.   Intro: Intro,
  74.   Rules: Rules,
  75.   PreGame: PreGame
  76. })
  77.  
  78. const RankTab = createBottomTabNavigator({
  79.   PreGame: PreGame,
  80.   Game: Game
  81. })
  82.  
  83. export default Navig = createSwitchNavigator({
  84.   Intro: IntroStack,
  85.   Game: Game,
  86.   Ranking: RankTab
  87. })
  88.  
  89. const styles = StyleSheet.create({
  90.   container: {
  91.     flex: 1,
  92.     backgroundColor: '#fff',
  93.     alignItems: 'center',
  94.     justifyContent: 'center',
  95.   },
  96. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement