Browse Source

Add show modal button to SideMenu

Guy Carmeli 7 years ago
parent
commit
aa7e9b28e4
1 changed files with 19 additions and 2 deletions
  1. 19
    2
      example/src/screens/types/Drawer.js

+ 19
- 2
example/src/screens/types/Drawer.js View File

1
 import React from 'react';
1
 import React from 'react';
2
-import {StyleSheet, View, Text} from 'react-native';
2
+import {StyleSheet, View, Button} from 'react-native';
3
 
3
 
4
 class MyClass extends React.Component {
4
 class MyClass extends React.Component {
5
 
5
 
6
+  onShowModal = () => {
7
+    this.props.navigator.toggleDrawer({
8
+      side: 'left'
9
+    });
10
+    this.props.navigator.showModal({
11
+      screen: 'example.Types.Modal',
12
+      title: `Modal`
13
+    });
14
+  };
15
+
6
   render() {
16
   render() {
7
     return (
17
     return (
8
       <View style={styles.container}>
18
       <View style={styles.container}>
9
-
19
+        <View style={styles.button}>
20
+          <Button
21
+            onPress={this.onShowModal}
22
+            title="Show Modal"/>
23
+        </View>
10
       </View>
24
       </View>
11
     );
25
     );
12
   }
26
   }
20
     justifyContent: 'center',
34
     justifyContent: 'center',
21
     backgroundColor: '#ffffff',
35
     backgroundColor: '#ffffff',
22
   },
36
   },
37
+  button: {
38
+    marginTop: 16
39
+  }
23
 });
40
 });
24
 
41
 
25
 export default MyClass;
42
 export default MyClass;