Browse Source

Tabs -> BottomTabs

Daniel Zlotin 7 years ago
parent
commit
b2a775a1f8

+ 1
- 1
ios/RNNLayoutNode.m View File

23
 }
23
 }
24
 -(BOOL)isTabs
24
 -(BOOL)isTabs
25
 {
25
 {
26
-	return [self.type isEqualToString:@"Tabs"];
26
+	return [self.type isEqualToString:@"BottomTabs"];
27
 }
27
 }
28
 -(BOOL)isSideMenuRoot
28
 -(BOOL)isSideMenuRoot
29
 {
29
 {

+ 5
- 5
src/commands/LayoutTreeCrawler.test.js View File

13
   });
13
   });
14
 
14
 
15
   it('crawls a layout tree and adds unique id to each node', () => {
15
   it('crawls a layout tree and adds unique id to each node', () => {
16
-    const node = { type: LayoutTypes.Container, children: [{ type: LayoutTypes.Tabs }] };
16
+    const node = { type: LayoutTypes.Container, children: [{ type: LayoutTypes.BottomTabs }] };
17
     uut.crawl(node);
17
     uut.crawl(node);
18
     expect(node.id).toEqual('Container+UNIQUE_ID');
18
     expect(node.id).toEqual('Container+UNIQUE_ID');
19
-    expect(node.children[0].id).toEqual('Tabs+UNIQUE_ID');
19
+    expect(node.children[0].id).toEqual('BottomTabs+UNIQUE_ID');
20
   });
20
   });
21
 
21
 
22
   it('crawls a layout tree and ensures data exists', () => {
22
   it('crawls a layout tree and ensures data exists', () => {
23
-    const node = { type: LayoutTypes.Container, children: [{ type: LayoutTypes.Tabs }] };
23
+    const node = { type: LayoutTypes.Container, children: [{ type: LayoutTypes.BottomTabs }] };
24
     uut.crawl(node);
24
     uut.crawl(node);
25
     expect(node.data).toEqual({});
25
     expect(node.data).toEqual({});
26
     expect(node.children[0].data).toEqual({});
26
     expect(node.children[0].data).toEqual({});
27
   });
27
   });
28
 
28
 
29
   it('crawls a layout tree and ensures children exists', () => {
29
   it('crawls a layout tree and ensures children exists', () => {
30
-    const node = { type: LayoutTypes.Container, children: [{ type: LayoutTypes.Tabs }] };
30
+    const node = { type: LayoutTypes.Container, children: [{ type: LayoutTypes.BottomTabs }] };
31
     uut.crawl(node);
31
     uut.crawl(node);
32
     expect(node.children[0].children).toEqual([]);
32
     expect(node.children[0].children).toEqual([]);
33
   });
33
   });
38
   });
38
   });
39
 
39
 
40
   it('saves passProps into store for Container nodes', () => {
40
   it('saves passProps into store for Container nodes', () => {
41
-    const node = { type: LayoutTypes.Tabs, children: [{ type: LayoutTypes.Container, data: { passProps: { myProp: 123 } } }] };
41
+    const node = { type: LayoutTypes.BottomTabs, children: [{ type: LayoutTypes.Container, data: { passProps: { myProp: 123 } } }] };
42
     expect(store.getPropsForContainerId('Container+UNIQUE_ID')).toEqual({});
42
     expect(store.getPropsForContainerId('Container+UNIQUE_ID')).toEqual({});
43
     uut.crawl(node);
43
     uut.crawl(node);
44
     expect(store.getPropsForContainerId('Container+UNIQUE_ID')).toEqual({ myProp: 123 });
44
     expect(store.getPropsForContainerId('Container+UNIQUE_ID')).toEqual({ myProp: 123 });

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

25
 
25
 
26
   _createTabs(tabs) {
26
   _createTabs(tabs) {
27
     return {
27
     return {
28
-      type: LayoutTypes.Tabs,
28
+      type: LayoutTypes.BottomTabs,
29
       children: _.map(tabs, (t) => this._createContainerStackWithContainerData(t.container))
29
       children: _.map(tabs, (t) => this._createContainerStackWithContainerData(t.container))
30
     };
30
     };
31
   }
31
   }

+ 2
- 2
src/commands/LayoutTreeParser.test.js View File

51
     it('parses tab based', () => {
51
     it('parses tab based', () => {
52
       expect(uut.parseFromSimpleJSON(SimpleLayouts.tabBasedApp))
52
       expect(uut.parseFromSimpleJSON(SimpleLayouts.tabBasedApp))
53
         .toEqual({
53
         .toEqual({
54
-          type: 'Tabs',
54
+          type: 'BottomTabs',
55
           children: [
55
           children: [
56
             {
56
             {
57
               type: 'ContainerStack',
57
               type: 'ContainerStack',
240
               type: 'SideMenuCenter',
240
               type: 'SideMenuCenter',
241
               children: [
241
               children: [
242
                 {
242
                 {
243
-                  type: 'Tabs',
243
+                  type: 'BottomTabs',
244
                   children: [
244
                   children: [
245
                     {
245
                     {
246
                       type: 'ContainerStack',
246
                       type: 'ContainerStack',

+ 1
- 1
src/commands/LayoutTypes.js View File

1
 export default {
1
 export default {
2
   Container: 'Container',
2
   Container: 'Container',
3
   ContainerStack: 'ContainerStack',
3
   ContainerStack: 'ContainerStack',
4
-  Tabs: 'Tabs',
4
+  BottomTabs: 'BottomTabs',
5
   SideMenuRoot: 'SideMenuRoot',
5
   SideMenuRoot: 'SideMenuRoot',
6
   SideMenuCenter: 'SideMenuCenter',
6
   SideMenuCenter: 'SideMenuCenter',
7
   SideMenuLeft: 'SideMenuLeft',
7
   SideMenuLeft: 'SideMenuLeft',