|
@@ -1,6 +1,6 @@
|
1
|
1
|
/*eslint-disable*/
|
2
|
|
-import { Component } from 'react';
|
3
|
|
-import { findNodeHandle } from 'react-native';
|
|
2
|
+import {Component} from 'react';
|
|
3
|
+import {findNodeHandle} from 'react-native';
|
4
|
4
|
import Navigation from './../Navigation';
|
5
|
5
|
import Controllers, {Modal, Notification, ScreenUtils} from './controllers';
|
6
|
6
|
const React = Controllers.hijackReact();
|
|
@@ -21,7 +21,7 @@ async function startTabBasedApp(params) {
|
21
|
21
|
}
|
22
|
22
|
|
23
|
23
|
const controllerID = _.uniqueId('controllerID');
|
24
|
|
- params.tabs.map(function(tab, index) {
|
|
24
|
+ params.tabs.map(function (tab, index) {
|
25
|
25
|
const navigatorID = controllerID + '_nav' + index;
|
26
|
26
|
const screenInstanceID = _.uniqueId('screenInstanceID');
|
27
|
27
|
|
|
@@ -54,7 +54,7 @@ async function startTabBasedApp(params) {
|
54
|
54
|
});
|
55
|
55
|
|
56
|
56
|
const Controller = Controllers.createClass({
|
57
|
|
- render: function() {
|
|
57
|
+ render: function () {
|
58
|
58
|
if (!params.drawer || (!params.drawer.left && !params.drawer.right)) {
|
59
|
59
|
return this.renderBody();
|
60
|
60
|
} else {
|
|
@@ -63,11 +63,11 @@ async function startTabBasedApp(params) {
|
63
|
63
|
const leftScreenId = _.uniqueId('screenInstanceID');
|
64
|
64
|
const rightScreenId = _.uniqueId('screenInstanceID')
|
65
|
65
|
|
66
|
|
- const { navigatorStyle: leftNavigatorStyle } = params.drawer.left
|
|
66
|
+ const {navigatorStyle: leftNavigatorStyle} = params.drawer.left
|
67
|
67
|
? _mergeScreenSpecificSettings(params.drawer.left.screen, leftScreenId, params.drawer.left)
|
68
|
68
|
: {};
|
69
|
69
|
|
70
|
|
- const { navigatorStyle: rightNavigatorStyle } = params.drawer.right
|
|
70
|
+ const {navigatorStyle: rightNavigatorStyle} = params.drawer.right
|
71
|
71
|
? _mergeScreenSpecificSettings(params.drawer.right.screen, rightScreenId, params.drawer.right)
|
72
|
72
|
: {};
|
73
|
73
|
|
|
@@ -140,25 +140,52 @@ async function startSingleScreenApp(params) {
|
140
|
140
|
return;
|
141
|
141
|
}
|
142
|
142
|
|
|
143
|
+ const controllerID = _.uniqueId('controllerID');
|
|
144
|
+ const navigatorID = controllerID + '_nav';
|
|
145
|
+
|
143
|
146
|
if (components) {
|
|
147
|
+ screen = components[0];
|
|
148
|
+ components.shift();
|
|
149
|
+
|
144
|
150
|
components.forEach(component => {
|
145
|
|
- screen = components[0];
|
146
|
|
- components.shift();
|
147
|
151
|
const screenInstanceID = _.uniqueId('screenInstanceID');
|
|
152
|
+
|
|
153
|
+ const {
|
|
154
|
+ navigatorStyle,
|
|
155
|
+ navigatorButtons,
|
|
156
|
+ navigatorEventID
|
|
157
|
+ } = _mergeScreenSpecificSettings(component.screen, screenInstanceID, params);
|
|
158
|
+ _saveNavigatorButtonsProps(navigatorButtons);
|
|
159
|
+ _saveNavBarComponentProps(navigatorStyle);
|
|
160
|
+ const passProps = Object.assign({}, params.passProps);
|
|
161
|
+ passProps.navigatorID = navigatorID;
|
|
162
|
+ passProps.screenInstanceID = screenInstanceID;
|
|
163
|
+ passProps.navigatorEventID = navigatorEventID;
|
|
164
|
+
|
|
165
|
+
|
148
|
166
|
component.navigationParams = {
|
149
|
|
- screenInstanceID
|
|
167
|
+ screenInstanceID,
|
|
168
|
+ navigatorStyle,
|
|
169
|
+ navigatorButtons,
|
|
170
|
+ navigatorEventID,
|
|
171
|
+ navigatorID: navigatorID,
|
|
172
|
+ passProps
|
150
|
173
|
};
|
|
174
|
+
|
|
175
|
+ component.subtitle = params.subtitle;
|
|
176
|
+ component.passProps = passProps;
|
|
177
|
+
|
151
|
178
|
savePassProps(component);
|
|
179
|
+
|
152
|
180
|
});
|
153
|
181
|
}
|
154
|
182
|
|
155
|
|
- const controllerID = _.uniqueId('controllerID');
|
156
|
183
|
if (!screen.screen) {
|
157
|
184
|
console.error('startSingleScreenApp(params): screen must include a screen property');
|
158
|
185
|
return;
|
159
|
186
|
}
|
160
|
187
|
|
161
|
|
- const navigatorID = controllerID + '_nav';
|
|
188
|
+
|
162
|
189
|
const screenInstanceID = _.uniqueId('screenInstanceID');
|
163
|
190
|
const {
|
164
|
191
|
navigatorStyle,
|
|
@@ -183,7 +210,7 @@ async function startSingleScreenApp(params) {
|
183
|
210
|
};
|
184
|
211
|
|
185
|
212
|
const Controller = Controllers.createClass({
|
186
|
|
- render: function() {
|
|
213
|
+ render: function () {
|
187
|
214
|
if (!params.drawer || (!params.drawer.left && !params.drawer.right)) {
|
188
|
215
|
return this.renderBody();
|
189
|
216
|
} else {
|
|
@@ -205,7 +232,7 @@ async function startSingleScreenApp(params) {
|
205
|
232
|
);
|
206
|
233
|
}
|
207
|
234
|
},
|
208
|
|
- renderBody: function() {
|
|
235
|
+ renderBody: function () {
|
209
|
236
|
return (
|
210
|
237
|
<NavigationControllerIOS
|
211
|
238
|
id={navigatorID}
|
|
@@ -544,7 +571,7 @@ function showModal(params) {
|
544
|
571
|
};
|
545
|
572
|
|
546
|
573
|
const Controller = Controllers.createClass({
|
547
|
|
- render: function() {
|
|
574
|
+ render: function () {
|
548
|
575
|
return (
|
549
|
576
|
<NavigationControllerIOS
|
550
|
577
|
id={navigatorID}
|
|
@@ -555,7 +582,7 @@ function showModal(params) {
|
555
|
582
|
passProps={passProps}
|
556
|
583
|
style={navigatorStyle}
|
557
|
584
|
leftButtons={navigatorButtons.leftButtons}
|
558
|
|
- rightButtons={navigatorButtons.rightButtons}/>
|
|
585
|
+ rightButtons={navigatorButtons.rightButtons} />
|
559
|
586
|
);
|
560
|
587
|
}
|
561
|
588
|
});
|