-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.android.js
89 lines (79 loc) · 2.84 KB
/
index.android.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
80
81
82
83
84
85
86
87
88
89
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Navigator
} from 'react-native';
import HomePage from './Pages/HomePage';
import LoginPage from './Pages/LoginPage';
import SignUpPage from './Pages/SignUpPage';
import StartPage from './Pages/StartPage';
import GameSettingsPage from './Pages/GameSettingsPage';
import LobbyAnyPage from './Pages/LobbyAnyPage';
import LobbyMakePage from './Pages/LobbyMakePage';
import LobbyJoinPage from './Pages/LobbyJoinPage';
import FriendsPage from './Pages/FriendsPage';
import AchievementsPage from './Pages/AchievementsPage';
import InstructionsPage from './Pages/InstructionsPage';
import GamePage from './Pages/GamePage';
var styles = require('./styles');
class AwesomeProject extends Component {
render() {
return (
<Navigator
initialRoute={{
page: "GamePage",
data:{ id: 1, name: 'Tai Lopez', wins: '27', pic: require('./images/tai.png') }
}}
renderScene={(route, navigator) => {
navigate = function(p,d){
if(p === "LogOut"){
navigator.popToTop();
}else{
navigator.push({
page: p,
data:d
});
}
};
back = function(){
navigator.pop();
};
switch(route.page){
case "Home":
return (<HomePage nav={navigate}/>);
case "Login":
return (<LoginPage nav={navigate} back={back}/>);
case "SignUp":
return (<SignUpPage nav={navigate} back={back}/>);
case "StartPage":
return (<StartPage nav={navigate} back={back}/>);
case "GameSettings":
return (<GameSettingsPage nav={navigate} back={back}/>);
case "LobbyAny":
return (<LobbyAnyPage nav={navigate} back={back}/>);
case "LobbyFriend":
return (<LobbyAnyPage nav={navigate} back={back} friend={route.data}/>);
case "LobbyMake":
return (<LobbyMakePage nav={navigate} back={back}/>);
case "LobbyJoin":
return (<LobbyJoinPage nav={navigate} back={back}/>);
case "Challange":
return (<FriendsPage nav={navigate} back={back}/>);
case "Achievements":
return (<AchievementsPage nav={navigate} back={back}/>);
case "Instructions":
return (<InstructionsPage nav={navigate} back={back}/>);
case "GamePage":
return (<GamePage nav={navigate} back={back} friend={route.data}/>);
default:
return(<StartPage nav={navigate} back={back}/>);
}
}}
/>
)
}
}
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);