-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.android.js
90 lines (83 loc) · 2.79 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
90
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Navigator,
AsyncStorage,
} from 'react-native';
import HomePage from './Pages/HomePage';
import LoginPage from './Pages/LoginPage';
import SignUpPage from './Pages/SignUpPage';
import StartPage from './Pages/StartPage';
import JoinPage from './Pages/JoinPage';
import WaitPage from './Pages/WaitPage';
import SettingsPage from './Pages/SettingsPage';
import MakePage from './Pages/MakePage';
import ZenPage from './Pages/ZenPage';
import ClassicPage from './Pages/ClassicPage';
import ResultsPage from './Pages/ResultsPage';
import Globals from './Logic/Globals'
class WordMerge extends Component {
constructor(props){
super(props);
}
render() {
return (
<Navigator
initialRoute={{
page: "Home",
data:{player:{ 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 "Start":
return (<StartPage nav={navigate} back={back}/>);
case "Join":
return (<JoinPage nav={navigate} back={back}/>);
case "Wait":
return (<WaitPage nav={navigate} back={back} mode={route.data.mode}/>);
case "Settings":
return (<SettingsPage nav={navigate} back={back} mode={route.data.mode}/>);
case "Make":
return (<MakePage nav={navigate} back={back} mode={route.data.mode}/>);
case "Zen":
return (<ZenPage nav={navigate} back={back} player={route.data.player}/>);
case "Classic":
return (<ClassicPage nav={navigate} back={back} player={route.data.player}/>);
case "Results":
return (<ResultsPage nav={navigate} back={back} data={route.data}/>);
default:
return(<StartPage nav={navigate} back={back}/>);
}
}}
/>
)
}
}
AppRegistry.registerComponent('WordMerge', () => WordMerge);