-
Notifications
You must be signed in to change notification settings - Fork 61
/
index.ios.js
executable file
·73 lines (66 loc) · 1.45 KB
/
index.ios.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
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Navigator,
View,
Text,
} = React;
var Home = require('./App/Views/Home');
var Login = require('./App/Views/Login');
var Register = require('./App/Views/Register');
var leanote = React.createClass({
render: function() {
return (
<View style={styles.container}>
<LoginView/>
</View>
);
}
});
var leanote = React.createClass({
getInitialState: function() {
return {
logined: false
};
},
renderScene: function(route, nav) {
switch (route.id) {
case 'home':
return <Home navigator={nav}/>;
case 'login':
return <Login navigator={nav}/>;
case 'register':
return <Register navigator={nav}/>
case 'jumping':
return <Vv navigator={nav}/>
default:
return (
<Login navigator={nav}/>
);
}
},
render: function() {
return (
<Navigator
style={{backgroundColor: '#fff'}}
initialRoute={{ id: "login" }}
renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FloatFromRight
}
}
/>
)
}
});
var styles = StyleSheet.create({
container: {
flex: 1
}
});
AppRegistry.registerComponent('leanote', () => leanote);