2 Commits

Author SHA1 Message Date
  Orlando04 3d2e705d5b Merge branch 'MocionesIUPI' of https://git.ccom.uprrp.edu/CCOM4030/JeLuOrRi into MocionesIUPI 2 years ago
  Orlando04 6610a4d0ac deleted unnecessary stuff 2 years ago
1 changed files with 2 additions and 21 deletions
  1. 2
    21
      MocionesIUPI/screens/MocionScreen.js

+ 2
- 21
MocionesIUPI/screens/MocionScreen.js View File

1
 import React, { useEffect, useState } from 'react';
1
 import React, { useEffect, useState } from 'react';
2
 import { ActivityIndicator, FlatList, Text, TouchableOpacity, View } from 'react-native';
2
 import { ActivityIndicator, FlatList, Text, TouchableOpacity, View } from 'react-native';
3
 import { globalStyles } from '../styles/global';
3
 import { globalStyles } from '../styles/global';
4
+import Card from '../shared/card';
4
 
5
 
5
 export default App = () => {
6
 export default App = () => {
6
   const [isLoading, setLoading] = useState(true);
7
   const [isLoading, setLoading] = useState(true);
8
   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
9
   const [PIN, setPIN] = useState([]); // this is looking for 'PIN' and it's content
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
   // this is for displaying the mocion on the screen
13
   // this is for displaying the mocion on the screen
34
   return (
14
   return (
35
     <View style={{ flex: 1, padding: 24 }}>
15
     <View style={{ flex: 1, padding: 24 }}>
16
+
36
       <Text>{Mocion}</Text>
17
       <Text>{Mocion}</Text>
37
       <Text>{Description}</Text>
18
       <Text>{Description}</Text>
38
     </View>
19
     </View>