-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.js
More file actions
86 lines (77 loc) · 2.2 KB
/
App.js
File metadata and controls
86 lines (77 loc) · 2.2 KB
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
80
81
82
83
84
85
86
import React, {Component} from 'react';
import { AppRegistry, StyleSheet, Text, View,Button } from 'react-native';
import { Provider } from 'react-redux'
import BackgroundTimer from 'react-native-background-timer';
import Authentication from "./components/Authentication"
import Lobby from "./components/Lobby"
import Room from "./components/Room"
import Loading from "./components/Loading"
import Game from "./components/Game"
import GhostRoom from "./components/GhostRoom"
import Logout from "./components/Logout"
import store from './redux/store'
import {locate} from './redux/actions'
import {StackNavigator} from 'react-navigation'
const Header = (Component) => (props) => {
return (
<View style ={styles.container}>
<Button color= 'darkred' title="Logout" onPress={()=>props.navigation.navigate('Logout')} />
<Component {...props}/>
</View>
)
}
// FirstPage: {
// screen: FirstPage,
// navigationOptions: {
// title: "FirstPage",
// header: {
// left: null,
// }
// },
// }
const Navigator = StackNavigator({
Authentication: { screen: Header(Authentication), navigationOptions: {
headerLeft: null}
},
Lobby: { screen: Header(Lobby), navigationOptions: {
headerLeft: null}
},
Room: { screen: Header(Room), navigationOptions: {
headerLeft: null}
},
Loading: { screen: Header(Loading), navigationOptions: {
headerLeft: null}
},
Game: { screen: Header(Game), navigationOptions: {
headerLeft: null}
},
GhostRoom: {screen: Header(GhostRoom), navigationOptions: {
headerLeft: null}
},
Logout: {screen: Logout}
});
AppRegistry.registerComponent('Navigator', () => Navigator);
export default class App extends Component {
constructor(props){
super(props);
}
render() {
return (
<Provider store = {store}>
<Navigator />
</Provider>
);
}
}
var styles = StyleSheet.create({
wrapper: { ...StyleSheet.absoluteFillObject, top: 0, bottom: 0, backgroundColor: 'black', },
container: {
borderColor: 'silver',
backgroundColor: 'black',
},
button: {
margin: 10,
color: 'white',
backgroundColor: 'darkred',
}
})