-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
81 lines (70 loc) · 2.61 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import React from 'react';
import { TouchableOpacity, Image } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import {createStackNavigator, createAppContainer, DrawerActions} from 'react-navigation';
//pantallas
import LoginScreen from './src/Screens/Login/LoginScreen';
import RegisterScreen from './src/Screens/Register/RegisterScreen';
import TabsContainer from './src/Screens/User/TabsContainer';
import RegionalModeScreen from './src/Screens/User/GameScreens/RegionalModeScreen';
import FreeModeScreen from './src/Screens/User/GameScreens/FreeModeScreen';
import GameResultScreen from './src/Screens/User/GameScreens/GameResultScreen';
export default class App extends React.Component {
render(){
return(
<App1/>
)
}
}
const MenuImage = ({navigation}) => {
if(!navigation.state.isDrawerOpen){
return <Ionicons name="md-menu" color="white" size={28} style={{marginLeft: 10}}/>
}else{
return <Ionicons name="md-arrow-round-back" color="white" size={28} style={{marginLeft: 10}}/>
}
}
const AppStackNavigator = createStackNavigator({
Login: {screen: LoginScreen},
Register: {screen: RegisterScreen},
Home: { screen: TabsContainer,
navigationOptions: ({navigation}) => ({
title: '¿Dónde?' ,
headerTintColor: '#fff',
headerStyle: {
backgroundColor: 'rgba(47, 69, 98, 1)'
},
headerLeft: <TouchableOpacity onPress={() => {navigation.dispatch(DrawerActions.toggleDrawer())} }>
<MenuImage name="md-menu" navigation={navigation}/>
</TouchableOpacity>,
})
},
RegionalMode: { screen: RegionalModeScreen,
navigationOptions: ({navigation}) => ({
headerStyle: {
backgroundColor: 'rgba(47, 69, 98, 1)'
},
title: 'Regional',
headerTintColor: '#fff'
})
},
FreeMode: { screen: FreeModeScreen,
navigationOptions: ({navigation}) => ({
headerStyle: {
backgroundColor: 'rgba(47, 69, 98, 1)'
},
title: 'Libre',
headerTintColor: '#fff'
})
},
Result: { screen: GameResultScreen,
navigationOptions: ({navigation}) => ({
headerStyle: {
backgroundColor: 'rgba(47, 69, 98, 1)'
},
title: 'Resultados',
headerTintColor: '#fff'
})
}
});
const App1 = createAppContainer(AppStackNavigator);
//export default App;