16 Commitit

Tekijä SHA1 Viesti Päivämäärä
  Jeann-Carlos 60701452ce Merge remote-tracking branch 'origin/PincodeB' into PincodeB 2 vuotta sitten
  Jeann-Carlos a7e2e51c5e Probando 2 vuotta sitten
  Orlando04 5e4d4394fc un nuevo cominenzo 2 vuotta sitten
  Orlando04 02308b197c Update PincodeScreen.js 2 vuotta sitten
  Orlando04 687b24fba3 un nuevo cominenzo 2 vuotta sitten
  Orlando04 4f81ee61ac un nuevo comienzo 2 vuotta sitten
  Ricardo-gonzalez32 d02a1aa1aa un nuevo comienzo 2 vuotta sitten
  Orlando04 5e21ea6d02 Un nuevo comienzo 2 vuotta sitten
  Ricardo-gonzalez32 0a05771e2a removed comment 2 vuotta sitten
  Orlando04 0ac18797fc deleted unnecessary stuff 2 vuotta sitten
  Orlando04 1c25b109f4 changes in HomeScreen 2 vuotta sitten
  Ricardo-gonzalez32 921f55aed8 increased pincode length to 6 2 vuotta sitten
  Ricardo-gonzalez32 16dde86a49 Update PincodeScreen.js 2 vuotta sitten
  Ricardo-gonzalez32 0400060485 Un nuevo comienzo 2 vuotta sitten
  Ricardo-gonzalez32 2fd42f89e3 added pincodescreen and testscreen 2 vuotta sitten
  Orlando04 0eda630696 added style for the header 2 vuotta sitten

+ 96
- 37
MocionesIUPI/package-lock.json Näytä tiedosto

10
       "dependencies": {
10
       "dependencies": {
11
         "@apollo/client": "^3.7.2",
11
         "@apollo/client": "^3.7.2",
12
         "@expo/webpack-config": "^0.17.2",
12
         "@expo/webpack-config": "^0.17.2",
13
-        "deprecated-react-native-prop-types": "^2.2.0",
14
         "expo": "~47.0.6",
13
         "expo": "~47.0.6",
15
         "expo-status-bar": "~1.4.2",
14
         "expo-status-bar": "~1.4.2",
16
         "graphql": "^15.8.0",
15
         "graphql": "^15.8.0",
18
         "react": "18.1.0",
17
         "react": "18.1.0",
19
         "react-dom": "18.1.0",
18
         "react-dom": "18.1.0",
20
         "react-native": "0.70.5",
19
         "react-native": "0.70.5",
20
+        "react-native-gesture-handler": "^2.8.0",
21
         "react-native-paper": "^3.12.0",
21
         "react-native-paper": "^3.12.0",
22
         "react-native-safe-area-context": "4.4.1",
22
         "react-native-safe-area-context": "4.4.1",
23
         "react-native-screens": "~3.18.0",
23
         "react-native-screens": "~3.18.0",
24
-        "react-native-smooth-pincode-input": "^1.0.9",
25
-        "react-native-svg": "13.4.0",
24
+        "react-native-svg": "^13.4.0",
26
         "react-native-vector-icons": "^9.2.0",
25
         "react-native-vector-icons": "^9.2.0",
27
         "react-native-web": "~0.18.9",
26
         "react-native-web": "~0.18.9",
27
+        "react-navigation-drawer": "^2.7.2",
28
         "react-navigation-material-bottom-tabs": "^2.3.5",
28
         "react-navigation-material-bottom-tabs": "^2.3.5",
29
         "react-navigation-stack": "^2.10.4",
29
         "react-navigation-stack": "^2.10.4",
30
         "styled-components": "^5.3.6",
30
         "styled-components": "^5.3.6",
1848
       "version": "2.0.17",
1848
       "version": "2.0.17",
1849
       "resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
1849
       "resolved": "https://registry.npmjs.org/@egjs/hammerjs/-/hammerjs-2.0.17.tgz",
1850
       "integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
1850
       "integrity": "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==",
1851
-      "peer": true,
1852
       "dependencies": {
1851
       "dependencies": {
1853
         "@types/hammerjs": "^2.0.36"
1852
         "@types/hammerjs": "^2.0.36"
1854
       },
1853
       },
5804
     "node_modules/@types/hammerjs": {
5803
     "node_modules/@types/hammerjs": {
5805
       "version": "2.0.41",
5804
       "version": "2.0.41",
5806
       "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz",
5805
       "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz",
5807
-      "integrity": "sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA==",
5808
-      "peer": true
5806
+      "integrity": "sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA=="
5809
     },
5807
     },
5810
     "node_modules/@types/html-minifier-terser": {
5808
     "node_modules/@types/html-minifier-terser": {
5811
       "version": "5.1.2",
5809
       "version": "5.1.2",
8215
         "url": "https://opencollective.com/webpack"
8213
         "url": "https://opencollective.com/webpack"
8216
       }
8214
       }
8217
     },
8215
     },
8216
+    "node_modules/core-js": {
8217
+      "version": "2.6.12",
8218
+      "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
8219
+      "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
8220
+      "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.",
8221
+      "hasInstallScript": true,
8222
+      "peer": true
8223
+    },
8218
     "node_modules/core-js-compat": {
8224
     "node_modules/core-js-compat": {
8219
       "version": "3.26.1",
8225
       "version": "3.26.1",
8220
       "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.26.1.tgz",
8226
       "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.26.1.tgz",
8894
         "node": ">= 0.6"
8900
         "node": ">= 0.6"
8895
       }
8901
       }
8896
     },
8902
     },
8897
-    "node_modules/deprecated-react-native-prop-types": {
8898
-      "version": "2.2.0",
8899
-      "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-2.2.0.tgz",
8900
-      "integrity": "sha512-SiessglRbgelU8sHCrGRImdlNKfVGSp0n6+K304d0rCdHGU8wladJkPmufxE2AkjN2jy71sgekNd9IvdZp9jZg==",
8901
-      "dependencies": {
8902
-        "@react-native/normalize-color": "*",
8903
-        "invariant": "*",
8904
-        "prop-types": "*"
8905
-      }
8906
-    },
8907
     "node_modules/des.js": {
8903
     "node_modules/des.js": {
8908
       "version": "1.0.1",
8904
       "version": "1.0.1",
8909
       "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
8905
       "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
9195
         "node": ">= 0.8"
9191
         "node": ">= 0.8"
9196
       }
9192
       }
9197
     },
9193
     },
9194
+    "node_modules/encoding": {
9195
+      "version": "0.1.13",
9196
+      "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
9197
+      "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
9198
+      "peer": true,
9199
+      "dependencies": {
9200
+        "iconv-lite": "^0.6.2"
9201
+      }
9202
+    },
9203
+    "node_modules/encoding/node_modules/iconv-lite": {
9204
+      "version": "0.6.3",
9205
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
9206
+      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
9207
+      "peer": true,
9208
+      "dependencies": {
9209
+        "safer-buffer": ">= 2.1.2 < 3.0.0"
9210
+      },
9211
+      "engines": {
9212
+        "node": ">=0.10.0"
9213
+      }
9214
+    },
9198
     "node_modules/end-of-stream": {
9215
     "node_modules/end-of-stream": {
9199
       "version": "1.4.4",
9216
       "version": "1.4.4",
9200
       "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
9217
       "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
12442
         "node": ">=0.10.0"
12459
         "node": ">=0.10.0"
12443
       }
12460
       }
12444
     },
12461
     },
12462
+    "node_modules/isomorphic-fetch": {
12463
+      "version": "2.2.1",
12464
+      "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
12465
+      "integrity": "sha512-9c4TNAKYXM5PRyVcwUZrF3W09nQ+sO7+jydgs4ZGW9dhsLG2VOlISJABombdQqQRXCwuYG3sYV/puGf5rp0qmA==",
12466
+      "peer": true,
12467
+      "dependencies": {
12468
+        "node-fetch": "^1.0.1",
12469
+        "whatwg-fetch": ">=0.10.0"
12470
+      }
12471
+    },
12472
+    "node_modules/isomorphic-fetch/node_modules/node-fetch": {
12473
+      "version": "1.7.3",
12474
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
12475
+      "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
12476
+      "peer": true,
12477
+      "dependencies": {
12478
+        "encoding": "^0.1.11",
12479
+        "is-stream": "^1.0.1"
12480
+      }
12481
+    },
12445
     "node_modules/jest-get-type": {
12482
     "node_modules/jest-get-type": {
12446
       "version": "26.3.0",
12483
       "version": "26.3.0",
12447
       "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz",
12484
       "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz",
16826
         "react": "18.1.0"
16863
         "react": "18.1.0"
16827
       }
16864
       }
16828
     },
16865
     },
16829
-    "node_modules/react-native-animatable": {
16830
-      "version": "1.3.3",
16831
-      "resolved": "https://registry.npmjs.org/react-native-animatable/-/react-native-animatable-1.3.3.tgz",
16832
-      "integrity": "sha512-2ckIxZQAsvWn25Ho+DK3d1mXIgj7tITkrS4pYDvx96WyOttSvzzFeQnM2od0+FUMzILbdHDsDEqZvnz1DYNQ1w==",
16833
-      "dependencies": {
16834
-        "prop-types": "^15.7.2"
16835
-      }
16836
-    },
16837
     "node_modules/react-native-codegen": {
16866
     "node_modules/react-native-codegen": {
16838
       "version": "0.70.6",
16867
       "version": "0.70.6",
16839
       "resolved": "https://registry.npmjs.org/react-native-codegen/-/react-native-codegen-0.70.6.tgz",
16868
       "resolved": "https://registry.npmjs.org/react-native-codegen/-/react-native-codegen-0.70.6.tgz",
16849
       "version": "2.8.0",
16878
       "version": "2.8.0",
16850
       "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.8.0.tgz",
16879
       "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.8.0.tgz",
16851
       "integrity": "sha512-poOSfz/w0IyD6Qwq7aaIRRfEaVTl1ecQFoyiIbpOpfNTjm2B1niY2FLrdVQIOtIOe+K9nH55Qal04nr4jGkHdQ==",
16880
       "integrity": "sha512-poOSfz/w0IyD6Qwq7aaIRRfEaVTl1ecQFoyiIbpOpfNTjm2B1niY2FLrdVQIOtIOe+K9nH55Qal04nr4jGkHdQ==",
16852
-      "peer": true,
16853
       "dependencies": {
16881
       "dependencies": {
16854
         "@egjs/hammerjs": "^2.0.17",
16882
         "@egjs/hammerjs": "^2.0.17",
16855
         "hoist-non-react-statics": "^3.3.0",
16883
         "hoist-non-react-statics": "^3.3.0",
16890
         "react-native-vector-icons": "*"
16918
         "react-native-vector-icons": "*"
16891
       }
16919
       }
16892
     },
16920
     },
16921
+    "node_modules/react-native-reanimated": {
16922
+      "version": "1.13.4",
16923
+      "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-1.13.4.tgz",
16924
+      "integrity": "sha512-sFbZFh0WanKTa0Fz7GXCZUjWpk/u04ytprcIs4Kb+ijfQHChXva3m3yQZfvbrhRbABJNHrdeuyDgJxDM2mcBgw==",
16925
+      "peer": true,
16926
+      "dependencies": {
16927
+        "fbjs": "^1.0.0"
16928
+      },
16929
+      "peerDependencies": {
16930
+        "react": "*",
16931
+        "react-native": "*"
16932
+      }
16933
+    },
16934
+    "node_modules/react-native-reanimated/node_modules/fbjs": {
16935
+      "version": "1.0.0",
16936
+      "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-1.0.0.tgz",
16937
+      "integrity": "sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==",
16938
+      "peer": true,
16939
+      "dependencies": {
16940
+        "core-js": "^2.4.1",
16941
+        "fbjs-css-vars": "^1.0.0",
16942
+        "isomorphic-fetch": "^2.1.1",
16943
+        "loose-envify": "^1.0.0",
16944
+        "object-assign": "^4.1.0",
16945
+        "promise": "^7.1.1",
16946
+        "setimmediate": "^1.0.5",
16947
+        "ua-parser-js": "^0.7.18"
16948
+      }
16949
+    },
16893
     "node_modules/react-native-safe-area-context": {
16950
     "node_modules/react-native-safe-area-context": {
16894
       "version": "4.4.1",
16951
       "version": "4.4.1",
16895
       "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.4.1.tgz",
16952
       "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.4.1.tgz",
16929
         "react-native": "*"
16986
         "react-native": "*"
16930
       }
16987
       }
16931
     },
16988
     },
16932
-    "node_modules/react-native-smooth-pincode-input": {
16933
-      "version": "1.0.9",
16934
-      "resolved": "https://registry.npmjs.org/react-native-smooth-pincode-input/-/react-native-smooth-pincode-input-1.0.9.tgz",
16935
-      "integrity": "sha512-4V4tyUGJaze55FHuJW/gYVOD3fc4Pd7cTIrv7liTRIXR49y09C2O3XqJUdgNR+UwTgLrTt/8L2lvEuEVUk3kig==",
16936
-      "dependencies": {
16937
-        "prop-types": "^15.5.10",
16938
-        "react-native-animatable": "^1.3.0"
16939
-      },
16940
-      "peerDependencies": {
16941
-        "react-native": "*"
16942
-      }
16943
-    },
16944
     "node_modules/react-native-svg": {
16989
     "node_modules/react-native-svg": {
16945
       "version": "13.4.0",
16990
       "version": "13.4.0",
16946
       "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.4.0.tgz",
16991
       "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.4.0.tgz",
17158
         "react-native": "*"
17203
         "react-native": "*"
17159
       }
17204
       }
17160
     },
17205
     },
17206
+    "node_modules/react-navigation-drawer": {
17207
+      "version": "2.7.2",
17208
+      "resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.7.2.tgz",
17209
+      "integrity": "sha512-AZgluZ8txCG+MrITF+VuHYAnnLaUQw/HvxHKWrAngy/CbmyEIgXEowvShCKMZDMa7PUtKY5+xuwgQtniGgGKsg==",
17210
+      "deprecated": "This package is no longer supported. Please use @react-navigation/drawer instead. See https://reactnavigation.org/docs/drawer-navigator/ for usage guide",
17211
+      "peerDependencies": {
17212
+        "react": "*",
17213
+        "react-native": "*",
17214
+        "react-native-gesture-handler": "^1.0.12",
17215
+        "react-native-reanimated": "^1.0.0",
17216
+        "react-native-screens": ">=1.0.0 || >= 2.0.0-alpha.0 || >= 2.0.0-beta.0 || >= 2.0.0",
17217
+        "react-navigation": "^4.1.1"
17218
+      }
17219
+    },
17161
     "node_modules/react-navigation-material-bottom-tabs": {
17220
     "node_modules/react-navigation-material-bottom-tabs": {
17162
       "version": "2.3.5",
17221
       "version": "2.3.5",
17163
       "resolved": "https://registry.npmjs.org/react-navigation-material-bottom-tabs/-/react-navigation-material-bottom-tabs-2.3.5.tgz",
17222
       "resolved": "https://registry.npmjs.org/react-navigation-material-bottom-tabs/-/react-navigation-material-bottom-tabs-2.3.5.tgz",

+ 4
- 7
MocionesIUPI/package.json Näytä tiedosto

11
   "dependencies": {
11
   "dependencies": {
12
     "@apollo/client": "^3.7.2",
12
     "@apollo/client": "^3.7.2",
13
     "@expo/webpack-config": "^0.17.2",
13
     "@expo/webpack-config": "^0.17.2",
14
-    "deprecated-react-native-prop-types": "^2.2.0",
15
     "expo": "~47.0.6",
14
     "expo": "~47.0.6",
16
     "expo-status-bar": "~1.4.2",
15
     "expo-status-bar": "~1.4.2",
17
     "graphql": "^15.8.0",
16
     "graphql": "^15.8.0",
18
     "native-base": "^3.4.25",
17
     "native-base": "^3.4.25",
19
     "react": "18.1.0",
18
     "react": "18.1.0",
20
     "react-dom": "18.1.0",
19
     "react-dom": "18.1.0",
21
-    "react-dom": "18.1.0",
22
     "react-native": "0.70.5",
20
     "react-native": "0.70.5",
21
+    "react-native-gesture-handler": "^2.8.0",
23
     "react-native-paper": "^3.12.0",
22
     "react-native-paper": "^3.12.0",
24
     "react-native-safe-area-context": "4.4.1",
23
     "react-native-safe-area-context": "4.4.1",
25
     "react-native-screens": "~3.18.0",
24
     "react-native-screens": "~3.18.0",
26
-    "react-native-smooth-pincode-input": "^1.0.9",
25
+    "react-native-svg": "^13.4.0",
27
     "react-native-vector-icons": "^9.2.0",
26
     "react-native-vector-icons": "^9.2.0",
28
     "react-native-web": "~0.18.9",
27
     "react-native-web": "~0.18.9",
28
+    "react-navigation-drawer": "^2.7.2",
29
     "react-navigation-material-bottom-tabs": "^2.3.5",
29
     "react-navigation-material-bottom-tabs": "^2.3.5",
30
     "react-navigation-stack": "^2.10.4",
30
     "react-navigation-stack": "^2.10.4",
31
-    "yarn": "^1.22.19",
32
-    "react-native-web": "~0.18.9",
33
     "styled-components": "^5.3.6",
31
     "styled-components": "^5.3.6",
34
     "styled-system": "^5.1.5",
32
     "styled-system": "^5.1.5",
35
-    "react-native-svg": "13.4.0",
36
-    "react-native-safe-area-context": "4.4.1"
33
+    "yarn": "^1.22.19"
37
   },
34
   },
38
   "devDependencies": {
35
   "devDependencies": {
39
     "@babel/core": "^7.12.9"
36
     "@babel/core": "^7.12.9"

+ 13
- 11
MocionesIUPI/routes/homeStack.js Näytä tiedosto

3
 import React from "react";
3
 import React from "react";
4
 
4
 
5
 import HomeScreen from '../screens/HomeScreen';
5
 import HomeScreen from '../screens/HomeScreen';
6
-import PincodeScreen from '../screens/PincodeScreen';
7
-import testscreen from '../screens/testscreen';
8
-
9
 import MocionScreen from '../screens/MocionScreen';
6
 import MocionScreen from '../screens/MocionScreen';
7
+import Header from '../shared/header';
10
 
8
 
11
 {/*Aqui deberan estar todas las pantallas de la aplicacion
9
 {/*Aqui deberan estar todas las pantallas de la aplicacion
12
    no olvide hacer 'import MyPage from './MyPage' */}
10
    no olvide hacer 'import MyPage from './MyPage' */}
13
 const screens = {
11
 const screens = {
14
     Home: {
12
     Home: {
15
         screen: HomeScreen,
13
         screen: HomeScreen,
16
-        backgroundColor: '#e81b39', // no se como hacer que despliegue color
14
+        navigationOptions: {
15
+           headerTitle: () => <Header />
16
+        }
17
     },
17
     },
18
 
18
 
19
     Mocion: {
19
     Mocion: {
20
         screen: MocionScreen,
20
         screen: MocionScreen,
21
-    },
21
+        navigationOptions: {
22
+            headerTitle: () => <Header />
23
+        }
22
 
24
 
23
-    Pinpage: {
24
-        screen: PincodeScreen,
25
-    },
26
 
25
 
27
-    test: {
28
-        screen: testscreen,
29
     }
26
     }
30
 }
27
 }
31
 
28
 
32
-const HomeStack = createStackNavigator(screens);
29
+const HomeStack = createStackNavigator(screens, {
30
+    defaultNavigationOptions: {
31
+        title: 'MocinesIUPI',
32
+        headerStyle:  { backgroundColor: "#e81b39",}
33
+    }
34
+});
33
 
35
 
34
 export default createAppContainer(HomeStack);
36
 export default createAppContainer(HomeStack);

+ 28
- 10
MocionesIUPI/screens/HomeScreen.js Näytä tiedosto

1
-import React from "react";
1
+import { propertiesListToString } from "@expo/config-plugins/build/android/Properties";
2
+import React, { useEffect, useState }from "react";
2
 import { StyleSheet, View, Text, Button } from 'react-native';
3
 import { StyleSheet, View, Text, Button } from 'react-native';
3
 import { globalStyles } from "../styles/global";
4
 import { globalStyles } from "../styles/global";
4
 
5
 
5
-export default function HomeScreen({ navigation }) {
6
-    
6
+export default App = ({ navigation }) => {
7
+    const [PIN, setPIN] = useState([]); // this is looking for 'PIN' and it's content
8
+  
9
+    // this connects us to the API and fetches the json file with the mociones
10
+    const getMociones = async () => {
11
+       try {
12
+        const response = await fetch('http://10.190.1.140:5000/send?PIN=121071'); // connection to the website 
13
+        const json = await response.json();
14
+  
15
+        // setting the content of each category 
16
+        setPIN(json.PIN);
17
+  
18
+      } catch (error) {
19
+        console.error(error);
20
+      } finally {
21
+        setLoading(false); // once found the loading icon will be replaced with the content of the json
22
+      }
23
+    }
24
+
7
     const pressHandler = () => {
25
     const pressHandler = () => {
8
-        navigation.navigate('Pinpage')
26
+        navigation.navigate('Mocion');
9
     }
27
     }
28
+    
29
+    useEffect(() => {
30
+        getMociones();
31
+      }, []);
10
 
32
 
11
     return (
33
     return (
12
         <View style = {globalStyles.container}>
34
         <View style = {globalStyles.container}>
13
             <Text style = {globalStyles.tittleText}>Home Screen</Text>
35
             <Text style = {globalStyles.tittleText}>Home Screen</Text>
14
-            <Button title='Ir a pagina de pin' onPress={pressHandler} />
36
+            <Button title="go to pin page" onPress={pressHandler}/>
15
         </View>
37
         </View>
16
-        
17
-        
18
-
19
     )
38
     )
20
-}
21
-
39
+}

+ 25
- 25
MocionesIUPI/screens/MocionScreen.js Näytä tiedosto

1
 import React, { useEffect, useState } from 'react';
1
 import React, { useEffect, useState } from 'react';
2
-import { ActivityIndicator, FlatList, Text, View } from 'react-native';
2
+import { ActivityIndicator, Button, FlatList, Text, TouchableOpacity, View } from 'react-native';
3
+import { globalStyles } from '../styles/global';
4
+import Card from '../shared/card';
3
 
5
 
4
 export default App = () => {
6
 export default App = () => {
5
   const [isLoading, setLoading] = useState(true);
7
   const [isLoading, setLoading] = useState(true);
6
   const [Description, setDescription] = useState([]); // this is looking for 'Description' and it's content
8
   const [Description, setDescription] = useState([]); // this is looking for 'Description' and it's content
7
   const [Mocion, setMocion] = useState([]); // this is looking for 'Mocion' and it's content
9
   const [Mocion, setMocion] = useState([]); // this is looking for 'Mocion' and it's content
8
-  const [PIN, setPIN] = useState([]); // this is looking for 'PIN' and it's content
10
+  
11
+      // this connects us to the API and fetches the json file with the mociones
12
+      const getMociones = async () => {
13
+        try {
14
+         const response = await fetch('http://192.168.1.200:5000/send?PIN=613382'); // connection to the website 
15
+         const json = await response.json();
16
+   
17
+         // setting the content of each category 
18
+         setMocion(json.Mocion); 
19
+         setDescription(json.Description);
20
+       } catch (error) {
21
+         console.error(error);
22
+       } finally {
23
+         setLoading(false); // once found the loading icon will be replaced with the content of the json
24
+       }
25
+     }
9
 
26
 
10
-  // this connects us to the API and fetches the json file with the mociones
11
-  const getMociones = async () => {
12
-     try {
13
-      const response = await fetch('http://10.190.1.140:5000/send?PIN=121071'); // connection to the website 
14
-      const json = await response.json();
27
+     useEffect(() => {
28
+      getMociones();
29
+    }, []);
15
 
30
 
16
-      // setting the content of each category 
17
-      setMocion(json.Mocion); 
18
-      setDescription(json.Description);
19
-      setPIN(json.PIN);
20
 
31
 
21
-    } catch (error) {
22
-      console.error(error);
23
-    } finally {
24
-      setLoading(false); // once found the loading icon will be replaced with the content of the json
25
-    }
26
-  }
27
-
28
-  useEffect(() => {
29
-    getMociones();
30
-  }, []);
31
-
32
-  // here we want to display each mocion in a flatlist 
33
-  // it's supposed to be like buttons. Once clicked it would let you vote inside
32
+  // this is for displaying the mocion on the screen
34
   return (
33
   return (
35
     <View style={{ flex: 1, padding: 24 }}>
34
     <View style={{ flex: 1, padding: 24 }}>
35
+
36
       <Text>{Mocion}</Text>
36
       <Text>{Mocion}</Text>
37
       <Text>{Description}</Text>
37
       <Text>{Description}</Text>
38
-      <Text>{PIN}</Text>
38
+      <Button title= 'A favor' color={'#e81b39'} />
39
     </View>
39
     </View>
40
   );
40
   );
41
 };
41
 };

+ 4
- 5
MocionesIUPI/screens/PincodeScreen.js Näytä tiedosto

3
 import { globalStyles } from "../styles/global";
3
 import { globalStyles } from "../styles/global";
4
 import SmoothPinCodeInput from 'react-native-smooth-pincode-input';
4
 import SmoothPinCodeInput from 'react-native-smooth-pincode-input';
5
 
5
 
6
-const pin = 123456;
7
 
6
 
8
-//comentario
7
+
9
 
8
 
10
 export default class App extends React.Component {
9
 export default class App extends React.Component {
11
     
10
     
12
     pressHandler = () => {
11
     pressHandler = () => {
13
     {/*Dentro del parentesis va el path al screen para redirigir*/}
12
     {/*Dentro del parentesis va el path al screen para redirigir*/}
14
-      this.props.navigation.navigate('test')
13
+      this.props.navigation.navigate('Mocion')
15
     }
14
     }
16
 
15
 
17
     state = {
16
     state = {
21
     pinInput = React.createRef();
20
     pinInput = React.createRef();
22
   
21
   
23
     _checkCode = (code) => {
22
     _checkCode = (code) => {
24
-      if (code != pin) {
23
+      if (code != this.props.navigation.state.params.Pin) { //this is for recieving the parameters from another screen
25
         this.pinInput.current.shake()
24
         this.pinInput.current.shake()
26
           .then(() => this.setState({ code: '' }));
25
           .then(() => this.setState({ code: '' }));
27
       } else {
26
       } else {
48
           </View>
47
           </View>
49
           
48
           
50
           <View style={globalStyles.container}>
49
           <View style={globalStyles.container}>
51
-            { pincode && <Button title='Ir a mocion' onPress={this.pressHandler} />}
50
+            { pincode && <Button title='Ir a mocion' color = {'#e81b39'} onPress={this.pressHandler} />}
52
           </View>
51
           </View>
53
 
52
 
54
         </View>
53
         </View>

+ 27
- 0
MocionesIUPI/shared/card.js Näytä tiedosto

1
+import React from "react";
2
+import { StyleSheet, View } from "react-native";
3
+
4
+export default function Card(props){
5
+    return (
6
+        <View style = {styles.card}>
7
+            <View style = {styles.cardContent}>
8
+                { props.childern }
9
+            </View>
10
+        </View>
11
+    )
12
+}
13
+
14
+const styles  = StyleSheet.create({
15
+  card: {
16
+    borderRadius: 6,
17
+    elevation: 3,
18
+    backgroundColor: '#fff', 
19
+    shadowOffset: { width: 1, height: 1},
20
+    shadowColor: '#333',
21
+    shadowOpacity: 0.3,
22
+  },
23
+
24
+  cardContent: {
25
+
26
+  },
27
+});

+ 42
- 0
MocionesIUPI/shared/header.js Näytä tiedosto

1
+import React from "react";
2
+import { StyleSheet, Text, View, Image } from 'react-native';
3
+import { MaterialIcons } from '@expo/vector-icons';
4
+
5
+export default function Header() {
6
+    return (
7
+        <View style = {styles.header}>
8
+            <View style = {styles.headerTitle}>
9
+              <Image source={require('../assets/logo.jpg')} style = {styles.headerImage}/>
10
+                <Text style = {styles.headerText}> MocinesIUPI </Text>
11
+            </View>
12
+        </View>
13
+    );
14
+}
15
+
16
+const styles = StyleSheet.create({
17
+  header: {
18
+    color: '#e81b3',
19
+    width: '100%',
20
+    height: '100%',
21
+    flexDirection: 'row',
22
+    alignItems: 'center',
23
+    justifyContent: 'center',
24
+  },
25
+
26
+  headerText: {
27
+    fontWeight: 'bold',
28
+    fontSize:20,
29
+    color: '#FFF',
30
+    letterSpacing: 1,
31
+  },
32
+
33
+  headerTitle: {
34
+    flexDirection: 'row',
35
+  },
36
+
37
+  headerImage: {
38
+    width: 42,
39
+    height: 42,
40
+    marginHorizontal: 15,
41
+  }
42
+});

+ 10
- 0
MocionesIUPI/styles/global.js Näytä tiedosto

14
   paragraph: {
14
   paragraph: {
15
     marginVertical: 8,
15
     marginVertical: 8,
16
     lineHeight: 20,
16
     lineHeight: 20,
17
+  },
18
+
19
+  button: {
20
+    alignItems: 'center',
21
+    justifyContent: 'center',
22
+    paddingVertical: 12,
23
+    paddingHorizontal: 32,
24
+    borderRadius: 4,
25
+    elevation: 3,
26
+    backgroundColor: '#e81b39',
17
   }
27
   }
18
 });
28
 });
19
 
29