Browse Source

move to moduleJS

Daniel Zlotin 7 years ago
parent
commit
82d10cce5a

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

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
 function start() {
4
 function start() {
6
   registerContainers();
5
   registerContainers();

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

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
 class LifecycleScreen extends Component {
8
 class LifecycleScreen extends Component {
7
   constructor(props) {
9
   constructor(props) {
41
     });
43
     });
42
   }
44
   }
43
 }
45
 }
44
-export default LifecycleScreen;
46
+module.exports = LifecycleScreen;
45
 
47
 
46
 const styles = {
48
 const styles = {
47
   root: {
49
   root: {

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

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
 class ModalScreen extends Component {
10
 class ModalScreen extends Component {
12
   constructor(props) {
11
   constructor(props) {
106
   }
105
   }
107
 };
106
 };
108
 
107
 
109
-export default ModalScreen;
108
+module.exports = ModalScreen;

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

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
 class OptionsScreen extends Component {
8
 class OptionsScreen extends Component {
11
   static get navigationOptions() {
9
   static get navigationOptions() {
89
   }
87
   }
90
 };
88
 };
91
 
89
 
92
-export default OptionsScreen;
90
+module.exports = OptionsScreen;

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

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
 class PushedScreen extends Component {
10
 class PushedScreen extends Component {
12
   constructor(props) {
11
   constructor(props) {
89
   }
88
   }
90
 };
89
 };
91
 
90
 
92
-export default PushedScreen;
91
+module.exports = PushedScreen;

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

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
 class ScrollViewScreen extends Component {
8
 class ScrollViewScreen extends Component {
12
   static get navigationOptions() {
9
   static get navigationOptions() {
39
     });
36
     });
40
   }
37
   }
41
 }
38
 }
39
+module.exports = ScrollViewScreen;
42
 
40
 
43
 const styles = StyleSheet.create({
41
 const styles = StyleSheet.create({
44
   contentContainer: {
42
   contentContainer: {
47
     height: 1000
45
     height: 1000
48
   }
46
   }
49
 });
47
 });
50
-export default ScrollViewScreen;

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

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
 class TextScreen extends Component {
10
 class TextScreen extends Component {
11
   render() {
11
   render() {
14
         <Text style={styles.h1}>{this.props.text || 'Text Screen'}</Text>
14
         <Text style={styles.h1}>{this.props.text || 'Text Screen'}</Text>
15
         {this.renderTextFromFunctionInProps()}
15
         {this.renderTextFromFunctionInProps()}
16
         <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
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
       </View>
18
       </View>
19
     );
19
     );
20
   }
20
   }
34
     });
34
     });
35
   }
35
   }
36
 }
36
 }
37
+module.exports = TextScreen;
37
 
38
 
38
 const styles = {
39
 const styles = {
39
   root: {
40
   root: {
59
   }
60
   }
60
 };
61
 };
61
 
62
 
62
-export default TextScreen;

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

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
 class WelcomeScreen extends Component {
7
 class WelcomeScreen extends Component {
7
   constructor(props) {
8
   constructor(props) {
132
   }
133
   }
133
 }
134
 }
134
 
135
 
135
-export default WelcomeScreen;
136
+module.exports = WelcomeScreen;
136
 
137
 
137
 const styles = {
138
 const styles = {
138
   root: {
139
   root: {

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

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
 function registerContainers() {
10
 function registerContainers() {
11
   Navigation.registerContainer(`navigation.playground.ScrollViewScreen`, () => ScrollViewScreen);
11
   Navigation.registerContainer(`navigation.playground.ScrollViewScreen`, () => ScrollViewScreen);

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

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