|
@@ -17,6 +17,23 @@ function startTabBasedApp(params) {
|
17
|
17
|
const controllerID = utils.getRandomId();
|
18
|
18
|
const Controller = Controllers.createClass({
|
19
|
19
|
render: function() {
|
|
20
|
+ if (!params.drawer || (!params.drawer.left && !params.drawer.right)) {
|
|
21
|
+ return this.renderBody();
|
|
22
|
+ } else {
|
|
23
|
+ const navigatorID = controllerID + '_drawer';
|
|
24
|
+ return (
|
|
25
|
+ <DrawerControllerIOS id={navigatorID}
|
|
26
|
+ componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
|
|
27
|
+ passPropsLeft={{navigatorID: navigatorID}}
|
|
28
|
+ componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
|
|
29
|
+ passPropsRight={{navigatorID: navigatorID}}
|
|
30
|
+ >
|
|
31
|
+ {this.renderBody()}
|
|
32
|
+ </DrawerControllerIOS>
|
|
33
|
+ );
|
|
34
|
+ }
|
|
35
|
+ },
|
|
36
|
+ renderBody: function() {
|
20
|
37
|
return (
|
21
|
38
|
<TabBarControllerIOS id={controllerID + '_tabs'}>
|
22
|
39
|
{
|
|
@@ -68,6 +85,23 @@ function startSingleScreenApp(params) {
|
68
|
85
|
const controllerID = utils.getRandomId();
|
69
|
86
|
const Controller = Controllers.createClass({
|
70
|
87
|
render: function() {
|
|
88
|
+ if (!params.drawer || (!params.drawer.left && !params.drawer.right)) {
|
|
89
|
+ return this.renderBody();
|
|
90
|
+ } else {
|
|
91
|
+ const navigatorID = controllerID + '_drawer';
|
|
92
|
+ return (
|
|
93
|
+ <DrawerControllerIOS id={navigatorID}
|
|
94
|
+ componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
|
|
95
|
+ passPropsLeft={{navigatorID: navigatorID}}
|
|
96
|
+ componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
|
|
97
|
+ passPropsRight={{navigatorID: navigatorID}}
|
|
98
|
+ >
|
|
99
|
+ {this.renderBody()}
|
|
100
|
+ </DrawerControllerIOS>
|
|
101
|
+ );
|
|
102
|
+ }
|
|
103
|
+ },
|
|
104
|
+ renderBody: function() {
|
71
|
105
|
const screen = params.screen;
|
72
|
106
|
const navigatorID = controllerID + '_nav';
|
73
|
107
|
const screenInstanceID = utils.getRandomId();
|
|
@@ -174,6 +208,14 @@ function navigatorSetTitle(navigator, params) {
|
174
|
208
|
});
|
175
|
209
|
}
|
176
|
210
|
|
|
211
|
+function navigatorToggleDrawer(navigator, params) {
|
|
212
|
+ const controllerID = navigator.navigatorID.split('_')[0];
|
|
213
|
+ Controllers.DrawerControllerIOS(controllerID + '_drawer').toggle({
|
|
214
|
+ side: params.side,
|
|
215
|
+ animated: params.animated
|
|
216
|
+ });
|
|
217
|
+}
|
|
218
|
+
|
177
|
219
|
function navigatorSetButtons(navigator, navigatorEventID, params) {
|
178
|
220
|
if (params.leftButtons) {
|
179
|
221
|
const buttons = params.leftButtons.slice(); // clone
|
|
@@ -241,5 +283,6 @@ export default platformSpecific = {
|
241
|
283
|
showModal,
|
242
|
284
|
dismissModal,
|
243
|
285
|
navigatorSetButtons,
|
244
|
|
- navigatorSetTitle
|
|
286
|
+ navigatorSetTitle,
|
|
287
|
+ navigatorToggleDrawer
|
245
|
288
|
}
|