-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
62 lines (55 loc) · 1.3 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
Navigator,
} from 'react-native';
const window = Dimensions.get('window');
import Main from './Components/Main.js'
import Detail from './Components/Detail.js'
import FullList from './Components/FullList.js'
export default class Demo05 extends Component {
renderScene(route, navigator){
switch (route.name) {
case "main":return (
<Main
viewDetail={(data)=>{navigator.push({name:"detail", passProps:{
data: data
}})}}
clickItem ={()=>{navigator.push({name:"list"})}} />
);
case "detail":return (
<Detail
pop={()=>{navigator.pop();}}
data={route.passProps.data}
/>
);
case "list":return (
<FullList
pop1={()=>{navigator.pop();}}
viewDetail={(data)=>{navigator.push({name:"detail", passProps:{
data: data
}})}}
/>
);
default:
}
}
render() {
return (
<Navigator
initialRoute={{name:"main"}}
renderScene={(this.renderScene)}
/>
);
}
}
AppRegistry.registerComponent('Demo05', () => Demo05);