Browse Source

[+Jordi] 125 - initial Hello World application

Elisa Cutrin 1 year ago
commit
709b13a4bc
12 changed files with 12201 additions and 0 deletions
  1. 8 0
      .babelrc
  2. 75 0
      .flowconfig
  3. 18 0
      .gitignore
  4. 1 0
      .watchmanconfig
  5. 21 0
      App.js
  6. 9 0
      App.test.js
  7. 220 0
      README.md
  8. 5 0
      app.json
  9. 11769 0
      package-lock.json
  10. 26 0
      package.json
  11. 28 0
      screens/hello.js
  12. 21 0
      screens/world.js

+ 8 - 0
.babelrc

@@ -0,0 +1,8 @@
1
+{
2
+  "presets": ["babel-preset-expo"],
3
+  "env": {
4
+    "development": {
5
+      "plugins": ["transform-react-jsx-source"]
6
+    }
7
+  }
8
+}

+ 75 - 0
.flowconfig

@@ -0,0 +1,75 @@
1
+[ignore]
2
+; We fork some components by platform
3
+.*/*[.]android.js
4
+
5
+; Ignore templates for 'react-native init'
6
+<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.*
7
+
8
+; Ignore RN jest
9
+<PROJECT_ROOT>/node_modules/react-native/jest/.*
10
+
11
+; Ignore RNTester
12
+<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
13
+
14
+; Ignore the website subdir
15
+<PROJECT_ROOT>/node_modules/react-native/website/.*
16
+
17
+; Ignore the Dangerfile
18
+<PROJECT_ROOT>/node_modules/react-native/danger/dangerfile.js
19
+
20
+; Ignore Fbemitter
21
+<PROJECT_ROOT>/node_modules/fbemitter/.*
22
+
23
+; Ignore "BUCK" generated dirs
24
+<PROJECT_ROOT>/node_modules/react-native/\.buckd/
25
+
26
+; Ignore unexpected extra "@providesModule"
27
+.*/node_modules/.*/node_modules/fbjs/.*
28
+
29
+; Ignore polyfills
30
+<PROJECT_ROOT>/node_modules/react-native/Libraries/polyfills/.*
31
+
32
+; Ignore various node_modules
33
+<PROJECT_ROOT>/node_modules/react-native-gesture-handler/.*
34
+<PROJECT_ROOT>/node_modules/expo/.*
35
+<PROJECT_ROOT>/node_modules/react-navigation/.*
36
+<PROJECT_ROOT>/node_modules/xdl/.*
37
+<PROJECT_ROOT>/node_modules/reqwest/.*
38
+<PROJECT_ROOT>/node_modules/metro-bundler/.*
39
+
40
+[include]
41
+
42
+[libs]
43
+node_modules/react-native/Libraries/react-native/react-native-interface.js
44
+node_modules/react-native/flow/
45
+node_modules/expo/flow/
46
+
47
+[options]
48
+emoji=true
49
+
50
+module.system=haste
51
+
52
+module.file_ext=.js
53
+module.file_ext=.jsx
54
+module.file_ext=.json
55
+module.file_ext=.ios.js
56
+
57
+munge_underscores=true
58
+
59
+module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
60
+
61
+suppress_type=$FlowIssue
62
+suppress_type=$FlowFixMe
63
+suppress_type=$FlowFixMeProps
64
+suppress_type=$FlowFixMeState
65
+suppress_type=$FixMe
66
+
67
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
68
+suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
69
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
70
+suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
71
+
72
+unsafe.enable_getters_and_setters=true
73
+
74
+[version]
75
+^0.56.0

+ 18 - 0
.gitignore

@@ -0,0 +1,18 @@
1
+# See https://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+# expo
4
+.expo/
5
+.idea
6
+
7
+# dependencies
8
+/node_modules
9
+
10
+# misc
11
+.env.local
12
+.env.development.local
13
+.env.test.local
14
+.env.production.local
15
+
16
+npm-debug.log*
17
+yarn-debug.log*
18
+yarn-error.log*

+ 1 - 0
.watchmanconfig

@@ -0,0 +1 @@
1
+{}

+ 21 - 0
App.js

@@ -0,0 +1,21 @@
1
+import React from 'react';
2
+import { StyleSheet, Text, View } from 'react-native';
3
+import { Hello } from './screens/hello';
4
+import { World } from './screens/world';
5
+
6
+export default class App extends React.Component {
7
+  render() {
8
+    return (
9
+      <Hello />
10
+    );
11
+  }
12
+}
13
+
14
+const styles = StyleSheet.create({
15
+  container: {
16
+    flex: 1,
17
+    backgroundColor: '#fff',
18
+    alignItems: 'center',
19
+    justifyContent: 'center',
20
+  },
21
+});

+ 9 - 0
App.test.js

@@ -0,0 +1,9 @@
1
+import React from 'react';
2
+import App from './App';
3
+
4
+import renderer from 'react-test-renderer';
5
+
6
+it('renders without crashing', () => {
7
+  const rendered = renderer.create(<App />).toJSON();
8
+  expect(rendered).toBeTruthy();
9
+});

File diff suppressed because it is too large
+ 220 - 0
README.md


+ 5 - 0
app.json

@@ -0,0 +1,5 @@
1
+{
2
+  "expo": {
3
+    "sdkVersion": "26.0.0"
4
+  }
5
+}

File diff suppressed because it is too large
+ 11769 - 0
package-lock.json


+ 26 - 0
package.json

@@ -0,0 +1,26 @@
1
+{
2
+  "name": "redux-sample",
3
+  "version": "0.1.0",
4
+  "private": true,
5
+  "devDependencies": {
6
+    "react-native-scripts": "1.13.1",
7
+    "jest-expo": "26.0.0",
8
+    "react-test-renderer": "16.3.0-alpha.1"
9
+  },
10
+  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
11
+  "scripts": {
12
+    "start": "react-native-scripts start",
13
+    "eject": "react-native-scripts eject",
14
+    "android": "react-native-scripts android",
15
+    "ios": "react-native-scripts ios",
16
+    "test": "jest"
17
+  },
18
+  "jest": {
19
+    "preset": "jest-expo"
20
+  },
21
+  "dependencies": {
22
+    "expo": "^26.0.0",
23
+    "react": "16.3.0-alpha.1",
24
+    "react-native": "0.54.0"
25
+  }
26
+}

+ 28 - 0
screens/hello.js

@@ -0,0 +1,28 @@
1
+import React from 'react';
2
+import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
3
+
4
+export class Hello extends React.Component {
5
+
6
+  onPressButton = () => {
7
+    console.log('pressed :D')
8
+  };
9
+
10
+  render() {
11
+    return (
12
+      <View style={styles.container}>
13
+        <TouchableOpacity onPress={this.onPressButton} >
14
+          <Text>Hello!</Text>
15
+        </TouchableOpacity>
16
+      </View>
17
+    );
18
+  }
19
+}
20
+
21
+const styles = StyleSheet.create({
22
+  container: {
23
+    flex: 1,
24
+    backgroundColor: '#fff',
25
+    alignItems: 'center',
26
+    justifyContent: 'center',
27
+  },
28
+});

+ 21 - 0
screens/world.js

@@ -0,0 +1,21 @@
1
+import React from 'react';
2
+import { StyleSheet, Text, View } from 'react-native';
3
+
4
+export class World extends React.Component {
5
+  render() {
6
+    return (
7
+      <View style={styles.container}>
8
+        <Text>World!</Text>
9
+      </View>
10
+    );
11
+  }
12
+}
13
+
14
+const styles = StyleSheet.create({
15
+  container: {
16
+    flex: 1,
17
+    backgroundColor: '#fff',
18
+    alignItems: 'center',
19
+    justifyContent: 'center',
20
+  },
21
+});