Browse Source

Change "tabs" to "bottomTabs" (#1314)

* Change "tabs" to "bottomTabs"

* Fix failing test
Elliot Hesp 7 years ago
parent
commit
bb9a7a4002

+ 3
- 3
lib/src/commands/LayoutTreeParser.js View File

9
     if (simpleJsonApi.sideMenu) {
9
     if (simpleJsonApi.sideMenu) {
10
       return this._createSideMenu(simpleJsonApi);
10
       return this._createSideMenu(simpleJsonApi);
11
     }
11
     }
12
-    if (simpleJsonApi.tabs) {
13
-      return this._createTabs(simpleJsonApi.tabs);
12
+    if (simpleJsonApi.bottomTabs) {
13
+      return this._createTabs(simpleJsonApi.bottomTabs);
14
     }
14
     }
15
     return this._createContainerStackWithContainerData(simpleJsonApi.container);
15
     return this._createContainerStackWithContainerData(simpleJsonApi.container);
16
   }
16
   }
55
     children.push({
55
     children.push({
56
       type: LayoutTypes.SideMenuCenter,
56
       type: LayoutTypes.SideMenuCenter,
57
       children: [
57
       children: [
58
-        layout.tabs ? this._createTabs(layout.tabs) : this._createContainerStackWithContainerData(layout.container)
58
+        layout.bottomTabs ? this._createTabs(layout.bottomTabs) : this._createContainerStackWithContainerData(layout.container)
59
       ]
59
       ]
60
     });
60
     });
61
     if (layout.sideMenu.right) {
61
     if (layout.sideMenu.right) {

+ 1
- 1
lib/src/commands/LayoutTreeParser.test.js View File

219
         });
219
         });
220
     });
220
     });
221
 
221
 
222
-    it('parses tabs with side menus', () => {
222
+    it('parses bottomTabs with side menus', () => {
223
       expect(uut.parseFromSimpleJSON(SimpleLayouts.tabBasedWithBothSideMenus))
223
       expect(uut.parseFromSimpleJSON(SimpleLayouts.tabBasedWithBothSideMenus))
224
         .toEqual({
224
         .toEqual({
225
           type: 'SideMenuRoot',
225
           type: 'SideMenuRoot',

+ 2
- 2
lib/src/commands/SimpleLayouts.js View File

21
 };
21
 };
22
 
22
 
23
 export const tabBasedApp = {
23
 export const tabBasedApp = {
24
-  tabs: [
24
+  bottomTabs: [
25
     {
25
     {
26
       container: {
26
       container: {
27
         name: 'com.example.ATab'
27
         name: 'com.example.ATab'
85
 };
85
 };
86
 
86
 
87
 export const tabBasedWithBothSideMenus = {
87
 export const tabBasedWithBothSideMenus = {
88
-  tabs: [
88
+  bottomTabs: [
89
     {
89
     {
90
       container: {
90
       container: {
91
         name: 'com.example.FirstTab'
91
         name: 'com.example.FirstTab'

+ 2
- 2
playground/src/containers/WelcomeScreen.js View File

30
 
30
 
31
   onClickSwitchToTabs() {
31
   onClickSwitchToTabs() {
32
     Navigation.setRoot({
32
     Navigation.setRoot({
33
-      tabs: [
33
+      bottomTabs: [
34
         {
34
         {
35
           container: {
35
           container: {
36
             name: 'navigation.playground.TextScreen',
36
             name: 'navigation.playground.TextScreen',
54
 
54
 
55
   onClickSwitchToSideMenus() {
55
   onClickSwitchToSideMenus() {
56
     Navigation.setRoot({
56
     Navigation.setRoot({
57
-      tabs: [
57
+      bottomTabs: [
58
         {
58
         {
59
           container: {
59
           container: {
60
             name: 'navigation.playground.TextScreen',
60
             name: 'navigation.playground.TextScreen',