forked from CUNYTech/community_app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
front_end.js
51 lines (41 loc) · 1.21 KB
/
front_end.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 components needed
import React, { Component } from 'react';
import {
AppRegistry,
Navigator
} from 'react-native';
var Register = require('./components/Register');
var Congrats = require('./components/Congrats');
var Login = require('./components/Login');
var Main = require ('./components/Main');
class Community extends Component {
render() {
return (
<Navigator
initialRoute= {{
id:'Login'
}}
renderScene={
this.navigatorRenderScene
}
/>
);
}
//Class uses switch statement to navigate between different scenes using their IDs
navigatorRenderScene(route, navigator){
_navigator = navigator;
switch(route.id){
case'Register':
return(<Register navigator={navigator} title = "Register" />);
case'Congrats':
return(<Congrats navigator ={navigator} title ="Congrats" />);
case'Login':
return(<Login navigator ={navigator} title ="Login" />);
case 'Main':
return(<Main navigator = {navigator} title ="Main" />);
case 'Profile':
return(<Profile navigator ={navigator} title ="Profile" />);
}
}
}
AppRegistry.registerComponent('Community', () => Community);