Browse Source

move to moduleJS

Daniel Zlotin 7 years ago
parent
commit
82d10cce5a

+ 2
- 3
playground/src/app.js View File

@@ -1,6 +1,5 @@
1
-import Navigation from 'react-native-navigation';
2
-
3
-import { registerContainers } from './containers';
1
+const Navigation = require('react-native-navigation');
2
+const { registerContainers } = require('./containers');
4 3
 
5 4
 function start() {
6 5
   registerContainers();

+ 6
- 4
playground/src/containers/LifecycleScreen.js View File

@@ -1,7 +1,9 @@
1
-import React, { Component } from 'react';
2
-import { View, Text, Button } from 'react-native';
1
+const React = require('react');
2
+const { Component } = require('react');
3 3
 
4
-import Navigation from 'react-native-navigation';
4
+const { View, Text, Button } = require('react-native');
5
+
6
+const Navigation = require('react-native-navigation');
5 7
 
6 8
 class LifecycleScreen extends Component {
7 9
   constructor(props) {
@@ -41,7 +43,7 @@ class LifecycleScreen extends Component {
41 43
     });
42 44
   }
43 45
 }
44
-export default LifecycleScreen;
46
+module.exports = LifecycleScreen;
45 47
 
46 48
 const styles = {
47 49
   root: {

+ 8
- 9
playground/src/containers/ModalScreen.js View File

@@ -1,12 +1,11 @@
1
-import _ from 'lodash';
2
-import React, { Component } from 'react';
3
-import {
4
-  View,
5
-  Text,
6
-  Button
7
-} from 'react-native';
1
+const _ = require('lodash');
8 2
 
9
-import Navigation from 'react-native-navigation';
3
+const React = require('react');
4
+const { Component } = require('react');
5
+
6
+const { View, Text, Button } = require('react-native');
7
+
8
+const Navigation = require('react-native-navigation');
10 9
 
11 10
 class ModalScreen extends Component {
12 11
   constructor(props) {
@@ -106,4 +105,4 @@ const styles = {
106 105
   }
107 106
 };
108 107
 
109
-export default ModalScreen;
108
+module.exports = ModalScreen;

+ 6
- 8
playground/src/containers/OptionsScreen.js View File

@@ -1,11 +1,9 @@
1
-import React, { Component } from 'react';
2
-import {
3
-  View,
4
-  Text,
5
-  Button
6
-} from 'react-native';
1
+const React = require('react');
2
+const { Component } = require('react');
7 3
 
8
-import Navigation from 'react-native-navigation';
4
+const { View, Text, Button } = require('react-native');
5
+
6
+const Navigation = require('react-native-navigation');
9 7
 
10 8
 class OptionsScreen extends Component {
11 9
   static get navigationOptions() {
@@ -89,4 +87,4 @@ const styles = {
89 87
   }
90 88
 };
91 89
 
92
-export default OptionsScreen;
90
+module.exports = OptionsScreen;

+ 8
- 9
playground/src/containers/PushedScreen.js View File

@@ -1,12 +1,11 @@
1
-import _ from 'lodash';
2
-import React, { Component } from 'react';
3
-import {
4
-  View,
5
-  Text,
6
-  Button
7
-} from 'react-native';
1
+const _ = require('lodash');
8 2
 
9
-import Navigation from 'react-native-navigation';
3
+const React = require('react');
4
+const { Component } = require('react');
5
+
6
+const { View, Text, Button } = require('react-native');
7
+
8
+const Navigation = require('react-native-navigation');
10 9
 
11 10
 class PushedScreen extends Component {
12 11
   constructor(props) {
@@ -89,4 +88,4 @@ const styles = {
89 88
   }
90 89
 };
91 90
 
92
-export default PushedScreen;
91
+module.exports = PushedScreen;

+ 6
- 9
playground/src/containers/ScrollViewScreen.js View File

@@ -1,12 +1,9 @@
1
-import React, { Component } from 'react';
2
-import {
3
-  StyleSheet,
4
-  ScrollView,
5
-  View,
6
-  Button
7
-} from 'react-native';
1
+const React = require('react');
2
+const { Component } = require('react');
8 3
 
9
-import Navigation from 'react-native-navigation';
4
+const { StyleSheet, ScrollView, View, Button } = require('react-native');
5
+
6
+const Navigation = require('react-native-navigation');
10 7
 
11 8
 class ScrollViewScreen extends Component {
12 9
   static get navigationOptions() {
@@ -39,6 +36,7 @@ class ScrollViewScreen extends Component {
39 36
     });
40 37
   }
41 38
 }
39
+module.exports = ScrollViewScreen;
42 40
 
43 41
 const styles = StyleSheet.create({
44 42
   contentContainer: {
@@ -47,4 +45,3 @@ const styles = StyleSheet.create({
47 45
     height: 1000
48 46
   }
49 47
 });
50
-export default ScrollViewScreen;

+ 10
- 10
playground/src/containers/TextScreen.js View File

@@ -1,11 +1,11 @@
1
-import _ from 'lodash/math';
2
-import React, { Component } from 'react';
3
-import {
4
-  View,
5
-  Text,
6
-  Button
7
-} from 'react-native';
8
-import Navigation from 'react-native-navigation';
1
+const _ = require('lodash/math');
2
+
3
+const React = require('react');
4
+const { Component } = require('react');
5
+
6
+const { View, Text, Button } = require('react-native');
7
+
8
+const Navigation = require('react-native-navigation');
9 9
 
10 10
 class TextScreen extends Component {
11 11
   render() {
@@ -14,7 +14,7 @@ class TextScreen extends Component {
14 14
         <Text style={styles.h1}>{this.props.text || 'Text Screen'}</Text>
15 15
         {this.renderTextFromFunctionInProps()}
16 16
         <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
17
-        <Button title={'setTabBadge'} onPress={() => this.onButtonPress()}/>
17
+        <Button title={'setTabBadge'} onPress={() => this.onButtonPress()} />
18 18
       </View>
19 19
     );
20 20
   }
@@ -34,6 +34,7 @@ class TextScreen extends Component {
34 34
     });
35 35
   }
36 36
 }
37
+module.exports = TextScreen;
37 38
 
38 39
 const styles = {
39 40
   root: {
@@ -59,4 +60,3 @@ const styles = {
59 60
   }
60 61
 };
61 62
 
62
-export default TextScreen;

+ 5
- 4
playground/src/containers/WelcomeScreen.js View File

@@ -1,7 +1,8 @@
1
-import React, { Component } from 'react';
2
-import { View, Text, Button } from 'react-native';
1
+const React = require('react');
2
+const { Component } = require('react');
3
+const { View, Text, Button } = require('react-native');
3 4
 
4
-import Navigation from 'react-native-navigation';
5
+const Navigation = require('react-native-navigation');
5 6
 
6 7
 class WelcomeScreen extends Component {
7 8
   constructor(props) {
@@ -132,7 +133,7 @@ class WelcomeScreen extends Component {
132 133
   }
133 134
 }
134 135
 
135
-export default WelcomeScreen;
136
+module.exports = WelcomeScreen;
136 137
 
137 138
 const styles = {
138 139
   root: {

+ 8
- 8
playground/src/containers/index.js View File

@@ -1,11 +1,11 @@
1
-import Navigation from 'react-native-navigation';
2
-import WelcomeScreen from './WelcomeScreen';
3
-import TextScreen from './TextScreen';
4
-import PushedScreen from './PushedScreen';
5
-import LifecycleScreen from './LifecycleScreen';
6
-import ModalScreen from './ModalScreen';
7
-import OptionsScreen from './OptionsScreen';
8
-import ScrollViewScreen from './ScrollViewScreen';
1
+const Navigation = require('react-native-navigation');
2
+const WelcomeScreen = require('./WelcomeScreen');
3
+const TextScreen = require('./TextScreen');
4
+const PushedScreen = require('./PushedScreen');
5
+const LifecycleScreen = require('./LifecycleScreen');
6
+const ModalScreen = require('./ModalScreen');
7
+const OptionsScreen = require('./OptionsScreen');
8
+const ScrollViewScreen = require('./ScrollViewScreen');
9 9
 
10 10
 function registerContainers() {
11 11
   Navigation.registerContainer(`navigation.playground.ScrollViewScreen`, () => ScrollViewScreen);

+ 1
- 1
playground/src/index.js View File

@@ -1,3 +1,3 @@
1
-import { start } from './app';
1
+const { start } = require('./app');
2 2
 
3 3
 start();