-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.android.js
51 lines (48 loc) · 1.22 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
import React, {
AppRegistry,
Component,
StyleSheet,
Image,
Text,
TouchableHighlight,
Navigator,
View
} from 'react-native';
import Home from './App/Components/Home.js';
import JoinRoom from './App/Components/JoinRoom.js';
import Lobby from './App/Components/Lobby.js';
import UserMusic from './App/Components/UserMusic.js';
class Metro extends Component {
render () {
return (
<Navigator initialRoute={{id: 'Home', name: 'Home'}} renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FloatFromRight;
}}
/>
);
}
renderScene (route, navigator){
switch (route.id) {
case 'Home':
return (<Home navigator={navigator} />);
case 'JoinRoom':
return (<JoinRoom navigator={navigator} />);
case 'Lobby':
return (<Lobby navigator={navigator} />);
case 'UserMusic':
return (<UserMusic navigator={navigator} />);
}
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#c72a7e',
flex: 1,
flexDirection: 'column'
}
});
AppRegistry.registerComponent('Metro', () => Metro);