Browse Source

Fix style (#2031)

* Fix style

* Fix resolving logic

* Fix styling
Mike Grabowski 7 years ago
parent
commit
e2dea8a4e4

+ 4
- 2
ios/RCCDrawerController/RCCDrawerController.m View File

32
     // left
32
     // left
33
     NSString *componentLeft = props[@"componentLeft"];
33
     NSString *componentLeft = props[@"componentLeft"];
34
     NSDictionary *passPropsLeft = props[@"passPropsLeft"];
34
     NSDictionary *passPropsLeft = props[@"passPropsLeft"];
35
-    if (componentLeft) leftViewController = [[RCCViewController alloc] initWithComponent:componentLeft passProps:passPropsLeft navigatorStyle:nil globalProps:globalProps bridge:bridge];
35
+    NSDictionary *styleLeft = props[@"styleLeft"];
36
+    if (componentLeft) leftViewController = [[RCCViewController alloc] initWithComponent:componentLeft passProps:passPropsLeft navigatorStyle:styleLeft globalProps:globalProps bridge:bridge];
36
     
37
     
37
     // right
38
     // right
38
     NSString *componentRight = props[@"componentRight"];
39
     NSString *componentRight = props[@"componentRight"];
39
     NSDictionary *passPropsRight = props[@"passPropsRight"];
40
     NSDictionary *passPropsRight = props[@"passPropsRight"];
40
-    if (componentRight) rightViewController = [[RCCViewController alloc] initWithComponent:componentRight passProps:passPropsRight navigatorStyle:nil globalProps:globalProps bridge:bridge];
41
+    NSDictionary *styleRight = props[@"styleRight"];
42
+    if (componentRight) rightViewController = [[RCCViewController alloc] initWithComponent:componentRight passProps:passPropsRight navigatorStyle:styleRight globalProps:globalProps bridge:bridge];
41
     
43
     
42
     self = [super initWithCenterViewController:centerViewController
44
     self = [super initWithCenterViewController:centerViewController
43
                       leftDrawerViewController:leftViewController
45
                       leftDrawerViewController:leftViewController

+ 24
- 10
src/deprecated/platformSpecificDeprecated.ios.js View File

46
         return this.renderBody();
46
         return this.renderBody();
47
       } else {
47
       } else {
48
         const navigatorID = controllerID + '_drawer';
48
         const navigatorID = controllerID + '_drawer';
49
+
50
+        const leftScreenId = _.uniqueId('screenInstanceID');
51
+        const rightScreenId = _.uniqueId('screenInstanceID')
52
+
53
+        const { navigatorStyle: leftNavigatorStyle } = params.drawer.left
54
+          ? _mergeScreenSpecificSettings(params.drawer.left.screen, leftScreenId, params.drawer.left)
55
+          : {};
56
+
57
+        const { navigatorStyle: rightNavigatorStyle } = params.drawer.right
58
+          ? _mergeScreenSpecificSettings(params.drawer.right.screen, rightScreenId, params.drawer.right)
59
+          : {};
60
+
49
         return (
61
         return (
50
           <DrawerControllerIOS id={navigatorID}
62
           <DrawerControllerIOS id={navigatorID}
51
-                               componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
52
-                               passPropsLeft={{navigatorID: navigatorID}}
53
-                               componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
54
-                               passPropsRight={{navigatorID: navigatorID}}
55
-                               disableOpenGesture={params.drawer.disableOpenGesture}
56
-                               type={params.drawer.type ? params.drawer.type : 'MMDrawer'}
57
-                               animationType={params.drawer.animationType ? params.drawer.animationType : 'slide'}
58
-                               style={params.drawer.style}
59
-                               appStyle={params.appStyle}
63
+            componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
64
+            styleLeft={leftNavigatorStyle}
65
+            passPropsLeft={{navigatorID: navigatorID}}
66
+            componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
67
+            styleRight={rightNavigatorStyle}
68
+            passPropsRight={{navigatorID: navigatorID}}
69
+            disableOpenGesture={params.drawer.disableOpenGesture}
70
+            type={params.drawer.type ? params.drawer.type : 'MMDrawer'}
71
+            animationType={params.drawer.animationType ? params.drawer.animationType : 'slide'}
72
+            style={params.drawer.style}
73
+            appStyle={params.appStyle}
60
           >
74
           >
61
             {this.renderBody()}
75
             {this.renderBody()}
62
           </DrawerControllerIOS>
76
           </DrawerControllerIOS>
568
     navigatorEventID,
582
     navigatorEventID,
569
     navigatorID
583
     navigatorID
570
   };
584
   };
571
-  
585
+
572
   savePassProps(params);
586
   savePassProps(params);
573
 
587
 
574
   let args = {
588
   let args = {