|
@@ -20,16 +20,70 @@ class SideMenu extends Component {
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
onNavigatorEvent(event) {
|
23
|
|
- console.log('Unhandled event ' + event.id);
|
|
23
|
+ console.log('SideMenu', 'Unhandled event ' + event.id);
|
24
|
24
|
}
|
25
|
25
|
|
26
|
26
|
render() {
|
27
|
27
|
return (
|
28
|
|
- <View style={{flex: 1, padding: 20, backgroundColor: 'green'}}>
|
29
|
|
- <Text>Hello from SideMenu</Text>
|
|
28
|
+ <View style={styles.sideMenu}>
|
|
29
|
+ <Text style={styles.title}>Hello from SideMenu</Text>
|
|
30
|
+
|
|
31
|
+ <TouchableOpacity onPress={ this.onShowModalPress.bind(this) }>
|
|
32
|
+ <Text style={styles.button}>Show modal</Text>
|
|
33
|
+ </TouchableOpacity>
|
|
34
|
+
|
|
35
|
+ <TouchableOpacity onPress={ this.onPushScreenToTabOne.bind(this) }>
|
|
36
|
+ <Text style={styles.button}>Push screen to tab 1</Text>
|
|
37
|
+ </TouchableOpacity>
|
30
|
38
|
</View>
|
31
|
39
|
);
|
32
|
40
|
}
|
|
41
|
+
|
|
42
|
+ onShowModalPress() {
|
|
43
|
+ this.props.navigator.showModal({
|
|
44
|
+ title: "Modal Screen from SideMenu",
|
|
45
|
+ screen: "example.PushedScreen",
|
|
46
|
+ passProps: {
|
|
47
|
+ str: 'This is a prop passed in \'navigator.showModal()\'!',
|
|
48
|
+ obj: {
|
|
49
|
+ str: 'This is a prop passed in an object!',
|
|
50
|
+ arr: [
|
|
51
|
+ {
|
|
52
|
+ str: 'This is a prop in an object in an array in an object!'
|
|
53
|
+ }
|
|
54
|
+ ]
|
|
55
|
+ },
|
|
56
|
+ num: 1234
|
|
57
|
+ }
|
|
58
|
+ });
|
|
59
|
+ }
|
|
60
|
+
|
|
61
|
+ onPushScreenToTabOne() {
|
|
62
|
+ this.props.navigator.handleDeepLink({
|
|
63
|
+ link: 'tab1/pushScreen/example.PushedScreen'
|
|
64
|
+ });
|
|
65
|
+ }
|
33
|
66
|
}
|
34
|
67
|
|
|
68
|
+const styles = StyleSheet.create({
|
|
69
|
+ sideMenu: {
|
|
70
|
+ flex: 1,
|
|
71
|
+ backgroundColor: '#efefef',
|
|
72
|
+ padding: 20
|
|
73
|
+ },
|
|
74
|
+ title: {
|
|
75
|
+ textAlign: 'center',
|
|
76
|
+ marginBottom: 15
|
|
77
|
+ },
|
|
78
|
+ button: {
|
|
79
|
+ textAlign: 'center',
|
|
80
|
+ fontSize: 18,
|
|
81
|
+ borderBottomWidth: 1,
|
|
82
|
+ borderColor: 'grey',
|
|
83
|
+ marginBottom: 10,
|
|
84
|
+ marginTop:10,
|
|
85
|
+ color: 'black'
|
|
86
|
+ }
|
|
87
|
+});
|
|
88
|
+
|
35
|
89
|
export default connect()(SideMenu);
|