Quellcode durchsuchen

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

* Change "tabs" to "bottomTabs"

* Fix failing test
Elliot Hesp vor 7 Jahren
Ursprung
Commit
bb9a7a4002

+ 3
- 3
lib/src/commands/LayoutTreeParser.js Datei anzeigen

@@ -9,8 +9,8 @@ export default class LayoutTreeParser {
9 9
     if (simpleJsonApi.sideMenu) {
10 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 15
     return this._createContainerStackWithContainerData(simpleJsonApi.container);
16 16
   }
@@ -55,7 +55,7 @@ export default class LayoutTreeParser {
55 55
     children.push({
56 56
       type: LayoutTypes.SideMenuCenter,
57 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 61
     if (layout.sideMenu.right) {

+ 1
- 1
lib/src/commands/LayoutTreeParser.test.js Datei anzeigen

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

+ 2
- 2
lib/src/commands/SimpleLayouts.js Datei anzeigen

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

+ 2
- 2
playground/src/containers/WelcomeScreen.js Datei anzeigen

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