Browse Source

Update example redux

Guy Carmeli 8 years ago
parent
commit
3395c41dd9

+ 7
- 15
example-redux/src/app.js View File

@@ -72,33 +72,25 @@ export default class App {
72 72
             title: 'Login',
73 73
             topTabs: [
74 74
               {
75
-                screenId: 'example.ListScreen',
75
+                screenId: 'example.FirstTabScreen',
76 76
                 title: 'Tab1',
77 77
                 passProps: {
78
-                  str: 'This is a prop passed to Tab1'
79
-                }
80
-              },
81
-              {
82
-                screenId: 'example.PushedScreen',
83
-                title: 'Tab2',
84
-                passProps: {
85
-                  str: 'This is a prop passed to Tab2'
78
+                  str: 'This is a prop passed to Tab4',
79
+                  fn: () => 'Hello from a function passed as passProps!'
86 80
                 }
87
-
88 81
               },
89 82
               {
90 83
                 screenId: 'example.PushedScreen',
91 84
                 title: 'Tab3',
92 85
                 passProps: {
93
-                  str: 'This is a prop passed to Tab3'
86
+                  str: 'This is a prop passed to Tab2'
94 87
                 }
95 88
               },
96 89
               {
97
-                screenId: 'example.FirstTabScreen',
98
-                title: 'Tab4',
90
+                screenId: 'example.ListScreen',
91
+                title: 'Tab2',
99 92
                 passProps: {
100
-                  str: 'This is a prop passed to Tab4',
101
-                  fn: () => 'Hello from a function passed as passProps!'
93
+                  str: 'This is a prop passed to Tab1'
102 94
                 }
103 95
               }
104 96
             ],

+ 0
- 33
example-redux/src/screens/ListScreen.js View File

@@ -39,11 +39,6 @@ class ListScreen extends Component {
39 39
   }
40 40
 
41 41
   onNavigatorEvent(event) {
42
-    if (event.type == 'DeepLink') {
43
-      this.handleDeepLink(event);
44
-      return;
45
-    }
46
-
47 42
     if (event.id == 'tabSelected') {
48 43
       this.onTabSelected();
49 44
       return;
@@ -52,34 +47,6 @@ class ListScreen extends Component {
52 47
     console.log('ListScreen', 'Unhandled event ' + event.id);
53 48
   }
54 49
 
55
-  handleDeepLink(event) {
56
-    const parts = event.link.split('/');
57
-    if (parts[0] == 'tab1' && parts[1] == 'pushScreen') {
58
-      this.props.navigator.toggleDrawer({
59
-        side: 'left',
60
-        animated: true,
61
-        to: 'closed'
62
-      });
63
-
64
-      this.props.navigator.push({
65
-        title: "Pushed from SideMenu",
66
-        screen: parts[2],
67
-        passProps: {
68
-          str: 'This is a prop passed in \'navigator.push()\'!',
69
-          obj: {
70
-            str: 'This is a prop passed in an object!',
71
-            arr: [
72
-              {
73
-                str: 'This is a prop in an object in an array in an object!'
74
-              }
75
-            ]
76
-          },
77
-          num: 1234
78
-        }
79
-      });
80
-    }
81
-  }
82
-
83 50
   onTabSelected() {
84 51
     console.log('ListScreen', 'onTabSelected');
85 52
     this.props.navigator.setButtons({

+ 1
- 0
example-redux/src/screens/SideMenu.js View File

@@ -68,6 +68,7 @@ class SideMenu extends Component {
68 68
 const styles = StyleSheet.create({
69 69
   sideMenu: {
70 70
     flex: 1,
71
+    width: 250,
71 72
     backgroundColor: '#efefef',
72 73
     padding: 20
73 74
   },