Przeglądaj źródła

Toggle SideMenu before pushing screen

Guy Carmeli 9 lat temu
rodzic
commit
e89b018bc8

+ 6
- 0
example-redux/src/screens/ListScreen.js Wyświetl plik

42
     if (event.type == 'DeepLink') {
42
     if (event.type == 'DeepLink') {
43
       const parts = event.link.split('/');
43
       const parts = event.link.split('/');
44
       if (parts[0] == 'tab1' && parts[1] == 'pushScreen') {
44
       if (parts[0] == 'tab1' && parts[1] == 'pushScreen') {
45
+        this.props.navigator.toggleDrawer({
46
+          side: 'left',
47
+          animated: true,
48
+          to: 'closed'
49
+        });
50
+
45
         this.props.navigator.push({
51
         this.props.navigator.push({
46
           title: "Pushed from SideMenu",
52
           title: "Pushed from SideMenu",
47
           screen: parts[2],
53
           screen: parts[2],

+ 1
- 1
example-redux/src/screens/SideMenu.js Wyświetl plik

33
         </TouchableOpacity>
33
         </TouchableOpacity>
34
 
34
 
35
         <TouchableOpacity onPress={ this.onPushScreenToTabOne.bind(this) }>
35
         <TouchableOpacity onPress={ this.onPushScreenToTabOne.bind(this) }>
36
-          <Text style={styles.button}>Push screen to tab 1</Text>
36
+          <Text style={styles.button}>Push screen</Text>
37
         </TouchableOpacity>
37
         </TouchableOpacity>
38
       </View>
38
       </View>
39
     );
39
     );