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,12 +32,14 @@ UIViewController *rightViewController = nil;
32 32
     // left
33 33
     NSString *componentLeft = props[@"componentLeft"];
34 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 38
     // right
38 39
     NSString *componentRight = props[@"componentRight"];
39 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 44
     self = [super initWithCenterViewController:centerViewController
43 45
                       leftDrawerViewController:leftViewController

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

@@ -46,17 +46,31 @@ function startTabBasedApp(params) {
46 46
         return this.renderBody();
47 47
       } else {
48 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 61
         return (
50 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 75
             {this.renderBody()}
62 76
           </DrawerControllerIOS>
@@ -568,7 +582,7 @@ function showInAppNotification(params) {
568 582
     navigatorEventID,
569 583
     navigatorID
570 584
   };
571
-  
585
+
572 586
   savePassProps(params);
573 587
 
574 588
   let args = {