|
|
@@ -46,79 +46,113 @@ class WelcomeScreen extends Component {
|
|
46
|
46
|
|
|
47
|
47
|
onClickSwitchToTabs() {
|
|
48
|
48
|
Navigation.setRoot({
|
|
49
|
|
- bottomTabs: [
|
|
50
|
|
- {
|
|
51
|
|
- container: {
|
|
52
|
|
- name: 'navigation.playground.TextScreen',
|
|
53
|
|
- passProps: {
|
|
54
|
|
- text: 'This is tab 1',
|
|
55
|
|
- myFunction: () => 'Hello from a function!'
|
|
56
|
|
- },
|
|
57
|
|
- options: {
|
|
58
|
|
- bottomTab: {
|
|
59
|
|
- title: 'Tab 1',
|
|
60
|
|
- testID: testIDs.FIRST_TAB_BAR_BUTTON
|
|
61
|
|
- }
|
|
|
49
|
+ bottomTabs: {
|
|
|
50
|
+ children: [
|
|
|
51
|
+ {
|
|
|
52
|
+ stack: {
|
|
|
53
|
+ children: [
|
|
|
54
|
+ {
|
|
|
55
|
+ component: {
|
|
|
56
|
+ name: 'navigation.playground.TextScreen',
|
|
|
57
|
+ passProps: {
|
|
|
58
|
+ text: 'This is tab 1',
|
|
|
59
|
+ myFunction: () => 'Hello from a function!'
|
|
|
60
|
+ },
|
|
|
61
|
+ options: {
|
|
|
62
|
+ bottomTab: {
|
|
|
63
|
+ title: 'Tab 1',
|
|
|
64
|
+ testID: testIDs.FIRST_TAB_BAR_BUTTON
|
|
|
65
|
+ }
|
|
|
66
|
+ }
|
|
|
67
|
+ }
|
|
|
68
|
+ }
|
|
|
69
|
+ ]
|
|
62
|
70
|
}
|
|
63
|
|
- }
|
|
64
|
|
- },
|
|
65
|
|
- {
|
|
66
|
|
- container: {
|
|
67
|
|
- name: 'navigation.playground.TextScreen',
|
|
68
|
|
- passProps: {
|
|
69
|
|
- text: 'This is tab 2'
|
|
70
|
|
- },
|
|
71
|
|
- options: {
|
|
72
|
|
- bottomTab: {
|
|
73
|
|
- title: 'Tab 2',
|
|
74
|
|
- testID: testIDs.SECOND_TAB_BAR_BUTTON
|
|
75
|
|
- }
|
|
|
71
|
+ },
|
|
|
72
|
+ {
|
|
|
73
|
+ stack: {
|
|
|
74
|
+ children: [
|
|
|
75
|
+ {
|
|
|
76
|
+ component: {
|
|
|
77
|
+ name: 'navigation.playground.TextScreen',
|
|
|
78
|
+ passProps: {
|
|
|
79
|
+ text: 'This is tab 2'
|
|
|
80
|
+ },
|
|
|
81
|
+ options: {
|
|
|
82
|
+ bottomTab: {
|
|
|
83
|
+ title: 'Tab 2',
|
|
|
84
|
+ testID: testIDs.SECOND_TAB_BAR_BUTTON
|
|
|
85
|
+ }
|
|
|
86
|
+ }
|
|
|
87
|
+ }
|
|
|
88
|
+ }
|
|
|
89
|
+ ]
|
|
76
|
90
|
}
|
|
77
|
91
|
}
|
|
78
|
|
- }
|
|
79
|
|
- ]
|
|
|
92
|
+ ]
|
|
|
93
|
+ }
|
|
80
|
94
|
});
|
|
81
|
95
|
}
|
|
82
|
96
|
|
|
83
|
97
|
onClickSwitchToSideMenus() {
|
|
84
|
98
|
Navigation.setRoot({
|
|
85
|
|
- bottomTabs: [
|
|
86
|
|
- {
|
|
87
|
|
- container: {
|
|
88
|
|
- name: 'navigation.playground.TextScreen',
|
|
89
|
|
- passProps: {
|
|
90
|
|
- text: 'This is a side menu center screen tab 1'
|
|
91
|
|
- }
|
|
92
|
|
- }
|
|
93
|
|
- },
|
|
94
|
|
- {
|
|
95
|
|
- container: {
|
|
96
|
|
- name: 'navigation.playground.TextScreen',
|
|
97
|
|
- passProps: {
|
|
98
|
|
- text: 'This is a side menu center screen tab 2'
|
|
99
|
|
- }
|
|
100
|
|
- }
|
|
101
|
|
- },
|
|
102
|
|
- {
|
|
103
|
|
- container: {
|
|
104
|
|
- name: 'navigation.playground.TextScreen',
|
|
105
|
|
- passProps: {
|
|
106
|
|
- text: 'This is a side menu center screen tab 3'
|
|
107
|
|
- }
|
|
108
|
|
- }
|
|
109
|
|
- }
|
|
110
|
|
- ],
|
|
111
|
99
|
sideMenu: {
|
|
112
|
100
|
left: {
|
|
113
|
|
- container: {
|
|
|
101
|
+ component: {
|
|
114
|
102
|
name: 'navigation.playground.SideMenuScreen',
|
|
115
|
103
|
passProps: {
|
|
116
|
104
|
side: 'left'
|
|
117
|
105
|
}
|
|
118
|
106
|
}
|
|
119
|
107
|
},
|
|
|
108
|
+ center: {
|
|
|
109
|
+ bottomTabs: [
|
|
|
110
|
+ {
|
|
|
111
|
+ stack: {
|
|
|
112
|
+ children: [
|
|
|
113
|
+ {
|
|
|
114
|
+ component: {
|
|
|
115
|
+ name: 'navigation.playground.TextScreen',
|
|
|
116
|
+ passProps: {
|
|
|
117
|
+ text: 'This is a side menu center screen tab 1'
|
|
|
118
|
+ }
|
|
|
119
|
+ }
|
|
|
120
|
+ }
|
|
|
121
|
+ ]
|
|
|
122
|
+ }
|
|
|
123
|
+ },
|
|
|
124
|
+ {
|
|
|
125
|
+ stack: {
|
|
|
126
|
+ children: [
|
|
|
127
|
+ {
|
|
|
128
|
+ component: {
|
|
|
129
|
+ name: 'navigation.playground.TextScreen',
|
|
|
130
|
+ passProps: {
|
|
|
131
|
+ text: 'This is a side menu center screen tab 2'
|
|
|
132
|
+ }
|
|
|
133
|
+ }
|
|
|
134
|
+ }
|
|
|
135
|
+ ]
|
|
|
136
|
+ }
|
|
|
137
|
+ },
|
|
|
138
|
+ {
|
|
|
139
|
+ stack: {
|
|
|
140
|
+ children: [
|
|
|
141
|
+ {
|
|
|
142
|
+ component: {
|
|
|
143
|
+ name: 'navigation.playground.TextScreen',
|
|
|
144
|
+ passProps: {
|
|
|
145
|
+ text: 'This is a side menu center screen tab 3'
|
|
|
146
|
+ }
|
|
|
147
|
+ }
|
|
|
148
|
+ }
|
|
|
149
|
+ ]
|
|
|
150
|
+ }
|
|
|
151
|
+ }
|
|
|
152
|
+ ]
|
|
|
153
|
+ },
|
|
120
|
154
|
right: {
|
|
121
|
|
- container: {
|
|
|
155
|
+ component: {
|
|
122
|
156
|
name: 'navigation.playground.SideMenuScreen',
|
|
123
|
157
|
passProps: {
|
|
124
|
158
|
side: 'right'
|
|
|
@@ -131,19 +165,23 @@ class WelcomeScreen extends Component {
|
|
131
|
165
|
|
|
132
|
166
|
async onClickPush() {
|
|
133
|
167
|
await Navigation.push(this.props.containerId, {
|
|
134
|
|
- name: 'navigation.playground.PushedScreen'
|
|
|
168
|
+ component: {
|
|
|
169
|
+ name: 'navigation.playground.PushedScreen'
|
|
|
170
|
+ }
|
|
135
|
171
|
});
|
|
136
|
172
|
}
|
|
137
|
173
|
|
|
138
|
174
|
onClickLifecycleScreen() {
|
|
139
|
175
|
Navigation.push(this.props.containerId, {
|
|
140
|
|
- name: 'navigation.playground.LifecycleScreen'
|
|
|
176
|
+ component: {
|
|
|
177
|
+ name: 'navigation.playground.LifecycleScreen'
|
|
|
178
|
+ }
|
|
141
|
179
|
});
|
|
142
|
180
|
}
|
|
143
|
181
|
|
|
144
|
182
|
async onClickShowModal() {
|
|
145
|
183
|
await Navigation.showModal({
|
|
146
|
|
- container: {
|
|
|
184
|
+ component: {
|
|
147
|
185
|
name: 'navigation.playground.ModalScreen'
|
|
148
|
186
|
}
|
|
149
|
187
|
});
|
|
|
@@ -155,7 +193,9 @@ class WelcomeScreen extends Component {
|
|
155
|
193
|
|
|
156
|
194
|
onClickPushOptionsScreen() {
|
|
157
|
195
|
Navigation.push(this.props.containerId, {
|
|
158
|
|
- name: 'navigation.playground.OptionsScreen'
|
|
|
196
|
+ component: {
|
|
|
197
|
+ name: 'navigation.playground.OptionsScreen'
|
|
|
198
|
+ }
|
|
159
|
199
|
});
|
|
160
|
200
|
}
|
|
161
|
201
|
|
|
|
@@ -212,13 +252,17 @@ class WelcomeScreen extends Component {
|
|
212
|
252
|
|
|
213
|
253
|
onClickBackHandler() {
|
|
214
|
254
|
Navigation.push(this.props.containerId, {
|
|
215
|
|
- name: 'navigation.playground.BackHandlerScreen'
|
|
|
255
|
+ component: {
|
|
|
256
|
+ name: 'navigation.playground.BackHandlerScreen'
|
|
|
257
|
+ }
|
|
216
|
258
|
});
|
|
217
|
259
|
}
|
|
218
|
260
|
|
|
219
|
261
|
onClickPushOrientationMenuScreen() {
|
|
220
|
262
|
Navigation.push(this.props.containerId, {
|
|
221
|
|
- name: 'navigation.playground.OrientationSelectScreen'
|
|
|
263
|
+ component: {
|
|
|
264
|
+ name: 'navigation.playground.OrientationSelectScreen'
|
|
|
265
|
+ }
|
|
222
|
266
|
});
|
|
223
|
267
|
}
|
|
224
|
268
|
}
|