Orlando04 пре 2 година
родитељ
комит
6610a4d0ac
1 измењених фајлова са 2 додато и 21 уклоњено
  1. 2
    21
      MocionesIUPI/screens/MocionScreen.js

+ 2
- 21
MocionesIUPI/screens/MocionScreen.js Прегледај датотеку

@@ -1,6 +1,7 @@
1 1
 import React, { useEffect, useState } from 'react';
2 2
 import { ActivityIndicator, FlatList, Text, TouchableOpacity, View } from 'react-native';
3 3
 import { globalStyles } from '../styles/global';
4
+import Card from '../shared/card';
4 5
 
5 6
 export default App = () => {
6 7
   const [isLoading, setLoading] = useState(true);
@@ -8,31 +9,11 @@ export default App = () => {
8 9
   const [Mocion, setMocion] = useState([]); // this is looking for 'Mocion' and it's content
9 10
   const [PIN, setPIN] = useState([]); // this is looking for 'PIN' and it's content
10 11
 
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://10.190.1.140:5000/send?PIN=121071'); // 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
-      setPIN(json.PIN);
21
-
22
-    } catch (error) {
23
-      console.error(error);
24
-    } finally {
25
-      setLoading(false); // once found the loading icon will be replaced with the content of the json
26
-    }
27
-  }
28
-
29
-  useEffect(() => {
30
-    getMociones();
31
-  }, []);
32 12
 
33 13
   // this is for displaying the mocion on the screen
34 14
   return (
35 15
     <View style={{ flex: 1, padding: 24 }}>
16
+
36 17
       <Text>{Mocion}</Text>
37 18
       <Text>{Description}</Text>
38 19
     </View>