Selaa lähdekoodia

renamte to Options

Daniel Zlotin 7 vuotta sitten
vanhempi
commit
fddcebb059

+ 5
- 5
README.md Näytä tiedosto

@@ -33,14 +33,14 @@ v2 is written in Test Driven Development. We have a test for every feature inclu
33 33
 
34 34
 ## v2 Roadmap
35 35
 
36
-### Current Priorities 
36
+### Current Priorities
37 37
 
38 38
 1) buttons in Android
39 39
 2) showOverlay in iOS
40 40
 3) showOverlay in Android
41 41
 4) async commands
42
-5) currentTab 
43
-6) change navigationOptions to be nested
42
+5) currentTab
43
+6) change Options to be nested
44 44
 7) topTabs in both platforms, with API implications
45 45
 
46 46
 ### Top API
@@ -129,7 +129,7 @@ v2 is written in Test Driven Development. We have a test for every feature inclu
129 129
 | sideMenuVisible          |        [Contribute](/docs/docs/CONTRIBUTING.md)   | [Contribute](/docs/docs/CONTRIBUTING.md) |
130 130
 
131 131
 
132
-## v1 vs v2 Feature Comparison  
132
+## v1 vs v2 Feature Comparison
133 133
 v2 currently supports most of react-native-navigation’s basic functionality but it is still behind v1.
134 134
 Here is the full comparison of features between v1 and v2 (will be updated regularly):
135 135
 ### Top Level API
@@ -203,5 +203,5 @@ Note:  v1 properties with names beginning with 'navBar' are replaced in v2 with
203 203
 | customTransition(shared element)       |     :x:  |     WIP @bogobogo     | [Contribute](/docs/docs/CONTRIBUTING.md)|
204 204
 | splitViewScreen       |     :x:  |    [Contribute](/docs/docs/CONTRIBUTING.md)      | [Contribute](/docs/docs/CONTRIBUTING.md)|
205 205
 
206
-Element transitions, adding buttons and styles are not yet implemented. [Contribute](/docs/docs/CONTRIBUTING.md)  
206
+Element transitions, adding buttons and styles are not yet implemented. [Contribute](/docs/docs/CONTRIBUTING.md)
207 207
 

+ 1
- 1
docs/docs/Container.md Näytä tiedosto

@@ -7,5 +7,5 @@
7 7
 | name | <code>string</code> | The container's registered name |
8 8
 | topTabs | [<code>Array.&lt;Container&gt;</code>](#Container) |  |
9 9
 | passProps | <code>object</code> | props |
10
-| navigationOptions | <a href="https://wix.github.io/react-native-navigation/v2/#/docs/NavigationOptions">NavigationOptions</a> |  |
10
+| options | <a href="https://wix.github.io/react-native-navigation/v2/#/docs/Options">Options</a> |  |
11 11
 

+ 1
- 1
lib/src/commands/LayoutTreeCrawler.js Näytä tiedosto

@@ -33,7 +33,7 @@ class LayoutTreeCrawler {
33 33
 
34 34
   _applyStaticOptions(node) {
35 35
     const clazz = this.store.getOriginalContainerClassForName(node.data.name) || {};
36
-    const staticOptions = _.cloneDeep(clazz.navigationOptions) || {};
36
+    const staticOptions = _.cloneDeep(clazz.options) || {};
37 37
     const passedOptions = node.data.options || {};
38 38
     node.data.options = _.merge({}, staticOptions, passedOptions);
39 39
   }

+ 1
- 1
lib/src/commands/LayoutTreeCrawler.test.js Näytä tiedosto

@@ -70,7 +70,7 @@ describe('LayoutTreeCrawler', () => {
70 70
       opt: 'exists only in static'
71 71
     };
72 72
     const MyContainer = class {
73
-      static get navigationOptions() {
73
+      static get options() {
74 74
         return theStyle;
75 75
       }
76 76
     };

+ 3
- 3
lib/src/commands/OptionsProcessor.test.js Näytä tiedosto

@@ -97,11 +97,11 @@ describe('navigation options', () => {
97 97
     options.someKeyColor = 'rgb(255, 0, 255)';
98 98
     options.topBar = { textColor: 'red' };
99 99
     options.topBar.innerMostObj = { anotherColor: 'yellow' };
100
-    const navigationOptionsObj = new Options(options);
100
+    const optionsObj = new Options(options);
101 101
 
102
-    OptionsProcessor.processOptions(navigationOptionsObj);
102
+    OptionsProcessor.processOptions(optionsObj);
103 103
 
104
-    expect(navigationOptionsObj.topBar.textColor).toEqual(0xffff0000);
104
+    expect(optionsObj.topBar.textColor).toEqual(0xffff0000);
105 105
   });
106 106
 
107 107
   it('undefined value return undefined ', () => {

+ 1
- 1
playground/src/containers/BackHandlerScreen.js Näytä tiedosto

@@ -4,7 +4,7 @@ const { Component } = require('react');
4 4
 const { View, Text, Button, BackHandler } = require('react-native');
5 5
 
6 6
 class BackHandlerScreen extends Component {
7
-  static get navigationOptions() {
7
+  static get options() {
8 8
     return {
9 9
       topBar: {
10 10
         title: 'Back Handler',

+ 2
- 2
playground/src/containers/CustomTransitionDestination.js Näytä tiedosto

@@ -10,7 +10,7 @@ class CustomTransitionDestination extends Component {
10 10
     this.push = this.push.bind(this);
11 11
   }
12 12
 
13
-  static get navigationOptions() {
13
+  static get options() {
14 14
     return {
15 15
       backButtonTransition: 'custom',
16 16
       topBar: {
@@ -57,7 +57,7 @@ class CustomTransitionDestination extends Component {
57 57
           <Text style={styles.p}>{`Lorem ipsum dolor sit amet, consectetur adipiscing elit,
58 58
            sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
59 59
            Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
60
-           nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit 
60
+           nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
61 61
            in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
62 62
           cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum`}
63 63
           </Text>

+ 1
- 1
playground/src/containers/CustomTransitionOrigin.js Näytä tiedosto

@@ -8,7 +8,7 @@ class CustomTransitionOrigin extends Component {
8 8
     super(props);
9 9
     this.onClickNavigationIcon = this.onClickNavigationIcon.bind(this);
10 10
   }
11
-  static get navigationOptions() {
11
+  static get options() {
12 12
     return {
13 13
       topBar: {
14 14
         textFontFamily: 'HelveticaNeue-Italic',

+ 1
- 1
playground/src/containers/ModalScreen.js Näytä tiedosto

@@ -9,7 +9,7 @@ const Navigation = require('react-native-navigation');
9 9
 const testIDs = require('../testIDs');
10 10
 
11 11
 class ModalScreen extends Component {
12
-  static get navigationOptions() {
12
+  static get options() {
13 13
     return {
14 14
       orientation: ['portrait']
15 15
     };

+ 1
- 1
playground/src/containers/OptionsScreen.js Näytä tiedosto

@@ -11,7 +11,7 @@ const BUTTON_TWO = 'buttonTwo';
11 11
 const BUTTON_LEFT = 'buttonLeft';
12 12
 
13 13
 class OptionsScreen extends Component {
14
-  static get navigationOptions() {
14
+  static get options() {
15 15
     return {
16 16
       topBar: {
17 17
         title: 'Static Title',

+ 1
- 1
playground/src/containers/ScrollViewScreen.js Näytä tiedosto

@@ -7,7 +7,7 @@ const Navigation = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 class ScrollViewScreen extends Component {
10
-  static get navigationOptions() {
10
+  static get options() {
11 11
     return {
12 12
       topBar: {
13 13
         translucent: false

+ 1
- 1
playground/src/containers/TextScreen.js Näytä tiedosto

@@ -9,7 +9,7 @@ const testIDs = require('../testIDs');
9 9
 let globalFirstContainerID;
10 10
 
11 11
 class TextScreen extends Component {
12
-  static get navigationOptions() {
12
+  static get options() {
13 13
     return {
14 14
       bottomTabs: {
15 15
         testID: testIDs.BOTTOM_TABS_ELEMENT

+ 1
- 1
playground/src/containers/TopTabOptionsScreen.js Näytä tiedosto

@@ -5,7 +5,7 @@ const { View, Text, Button } = require('react-native');
5 5
 const Navigation = require('react-native-navigation');
6 6
 
7 7
 class TopTabOptionsScreen extends PureComponent {
8
-  static get navigationOptions() {
8
+  static get options() {
9 9
     return {
10 10
       topBar: {
11 11
         title: 'Tab 1',

+ 1
- 1
playground/src/containers/TopTabScreen.js Näytä tiedosto

@@ -4,7 +4,7 @@ const { View, Text } = require('react-native');
4 4
 const Navigation = require('react-native-navigation');
5 5
 
6 6
 class TopTabScreen extends PureComponent {
7
-  static get navigationOptions() {
7
+  static get options() {
8 8
     return {
9 9
       topBar: {
10 10
         textColor: 'black',

+ 7
- 7
playground/src/containers/WelcomeScreen.js Näytä tiedosto

@@ -7,7 +7,7 @@ const testIDs = require('../testIDs');
7 7
 const Navigation = require('react-native-navigation');
8 8
 
9 9
 class WelcomeScreen extends Component {
10
-  static get navigationOptions() {
10
+  static get options() {
11 11
     return {
12 12
       topBar: {
13 13
         largeTitle: false
@@ -54,7 +54,7 @@ class WelcomeScreen extends Component {
54 54
               text: 'This is tab 1',
55 55
               myFunction: () => 'Hello from a function!'
56 56
             },
57
-            navigationOptions: {
57
+            options: {
58 58
               bottomTab: {
59 59
                 title: 'Tab 1',
60 60
                 testID: testIDs.FIRST_TAB_BAR_BUTTON
@@ -68,7 +68,7 @@ class WelcomeScreen extends Component {
68 68
             passProps: {
69 69
               text: 'This is tab 2'
70 70
             },
71
-            navigationOptions: {
71
+            options: {
72 72
               bottomTab: {
73 73
                 title: 'Tab 2',
74 74
                 testID: testIDs.SECOND_TAB_BAR_BUTTON
@@ -168,7 +168,7 @@ class WelcomeScreen extends Component {
168 168
             title: 'Tab 1',
169 169
             text: 'This is top tab 1'
170 170
           },
171
-          navigationOptions: {
171
+          options: {
172 172
             topTab: {
173 173
               title: 'Tab 1'
174 174
             }
@@ -180,7 +180,7 @@ class WelcomeScreen extends Component {
180 180
             title: 'Tab 2',
181 181
             text: 'This is top tab 2'
182 182
           },
183
-          navigationOptions: {
183
+          options: {
184 184
             topTab: {
185 185
               title: 'Tab 2',
186 186
               titleFontFamily: 'Dosis-Regular'
@@ -193,14 +193,14 @@ class WelcomeScreen extends Component {
193 193
             title: 'Tab 3',
194 194
             text: 'This is top tab 3'
195 195
           },
196
-          navigationOptions: {
196
+          options: {
197 197
             topTab: {
198 198
               title: 'Tab 3'
199 199
             }
200 200
           }
201 201
         }
202 202
       ],
203
-      navigationOptions: {
203
+      options: {
204 204
         topTabs: {
205 205
           selectedTabColor: '#12766b',
206 206
           unselectedTabColor: 'red',