Преглед изворни кода

Pantalla de analisis añadida

andrelfuentes пре 1 година
родитељ
комит
976cac4540
4 измењених фајлова са 142 додато и 19 уклоњено
  1. 1
    1
      Navigation.js
  2. 137
    15
      screens/Analisis.js
  3. 2
    1
      screens/Drna.js
  4. 2
    2
      screens/Lista.js

+ 1
- 1
Navigation.js Прегледај датотеку

@@ -16,7 +16,7 @@ const StackDenuncias = createNativeStackNavigator();
16 16
 function Stacks() {
17 17
   return (
18 18
     <StackDenuncias.Navigator initialRouteName="DenunciasIni">
19
-      <StackDenuncias.Screen name="DenunciasIni" component={Denuncias} />
19
+      <StackDenuncias.Screen name="Denuncias" component={Denuncias} />
20 20
       <StackDenuncias.Screen name="Formulario" component={Formulario} />
21 21
       <StackDenuncias.Screen name="Lista" component={Lista} />
22 22
       <StackDenuncias.Screen name="Drna" component={Drna} />

+ 137
- 15
screens/Analisis.js Прегледај датотеку

@@ -3,24 +3,146 @@ import {
3 3
   View,
4 4
   Text,
5 5
   StyleSheet,
6
-  TouchableOpacity,
7
-  TextInput,
8 6
 } from "react-native";
9 7
 
8
+// TOOL DESCRIPTIONS
9
+const bodyEJScreen = "EJScreen es..... Presione para ir al enlace."
10
+const bodyCEJST = "CEJST es..... Presione para ir al enlace."
11
+const bodyEJAtlas = "EJAtlas es..... Presione para ir al enlace."
12
+const bodyIPCC = "El ''Intergovernmental Panel on Climate Change'' o IPCC es..... Presione para ir al enlace."
13
+
10 14
 const Analisis = () => {
11 15
   return (
12
-    <View>
13
-      <Text
14
-        style={{
15
-          fontSize: 30,
16
-          textAlign: "center",
17
-          marginTop: "20%",
18
-        }}
19
-      >
20
-        Herramientas de analisis
21
-      </Text>
22
-    </View>
23
-  );
24
-};
16
+  <View>
17
+
18
+    {/* TAB TITLE CODE*/}
19
+    {/* TAB TITLE */}
20
+    <Text style={styles.Tab}> 
21
+      Enlaces a Herramientas de Análisis Externas
22
+    </Text>
23
+  
24
+    {/* FIRST TOOL CODE*/}
25
+    {/* FIRST TOOL TITLE */}
26
+    <View style={styles.Number}>
27
+      <Text style={styles.Number}>
28
+        1)
29
+      </Text>
30
+      <Text style={styles.Title} 
31
+        onPress={ ()=> Linking.openURL('https://ejscreen.epa.gov/mapper/') }>
32
+        Enlace a EJScreen
33
+      </Text>
34
+    </View>
35
+    {/* FIRST TOOL BODY */}
36
+    <View style={styles.Bullet}>
37
+      <Text style={styles.Bullet}>
38
+        {'\u002D'}
39
+      </Text>
40
+      <Text style={styles.Body}>
41
+        {bodyEJScreen}
42
+      </Text>
43
+    </View>
44
+    
45
+    {/* SECOND TOOL CODE*/}
46
+    {/* SECOND TOOL TITLE */}
47
+    <View style={styles.Number}>
48
+      <Text style={styles.Number}>
49
+        2)</Text>
50
+      <Text style={styles.Title} 
51
+        onPress={ ()=> Linking.openURL('https://screeningtool.geoplatform.gov/en/#3/33.47/-97.5') }>
52
+        Enlace a CEJST
53
+      </Text>
54
+    </View>
55
+    {/* SECOND TOOL BODY */}
56
+    <View style={styles.Bullet}>
57
+      <Text style={styles.Bullet}>
58
+        {'\u002D'}
59
+      </Text>
60
+      <Text style={styles.Body}>
61
+        {bodyCEJST}
62
+      </Text>
63
+    </View>
64
+  
65
+    {/* THIRD TOOL CODE*/}
66
+    {/* THIRD TOOL TITLE */}
67
+    <View style={styles.Number}>
68
+      <Text style={styles.Number}>
69
+        3)
70
+      </Text>
71
+      <Text style={styles.Title} 
72
+        onPress={ ()=> Linking.openURL('https://ejatlas.org/') }>
73
+        Enlace a EJAtlas
74
+      </Text>
75
+    </View>
76
+    {/* THIRD TOOL BODY */}
77
+    <View style={styles.Bullet}>
78
+      <Text style={styles.Bullet}>
79
+        {'\u002D'}
80
+      </Text>
81
+      <Text style={styles.Body}>
82
+         {bodyEJAtlas}
83
+      </Text>
84
+    </View>
85
+  
86
+    {/* FOURTH TOOL CODE*/}
87
+    {/* FOURTH TOOL TITLE */}
88
+    <View style={styles.Number}>
89
+      <Text style={styles.Number}>
90
+        4)
91
+      </Text>
92
+      <Text style={styles.Title} 
93
+        onPress={ ()=> Linking.openURL('https://www.ipcc.ch/') }>
94
+        Enlace al IPCC
95
+      </Text>
96
+    </View>
97
+    {/* FOURTH TOOL BODY */}
98
+    <View style={styles.Bullet}>
99
+      <Text style={styles.Bullet}>
100
+        {'\u002D'}
101
+      </Text>
102
+      <Text style={styles.Body}>
103
+        {bodyIPCC}
104
+      </Text>
105
+    </View>
106
+          
107
+  </View>
108
+)}
109
+  
110
+const styles = StyleSheet.create({
111
+  Tab: { fontSize: 30,
112
+         textAlign: "center",
113
+         marginTop: "12%",
114
+         marginLeft: "1.4%",
115
+         marginRight: "1.4%"
116
+        },
117
+  
118
+  Number: { fontSize: 23,
119
+            textAlign: "left",
120
+            marginLeft: "2.5%",
121
+            marginTop: "5.5%",
122
+            flexDirection: 'row'
123
+          },
124
+  
125
+  Title: { fontSize: 23,
126
+           textAlign: "left",
127
+           marginTop: "5.5%", 
128
+           color: "#6495ed",
129
+           flex: 0,
130
+           paddingLeft: 6
131
+          },
132
+  
133
+  Body: { fontSize: 18,
134
+          textAlign: "left",
135
+          marginTop: "2%",
136
+          flex: 1, 
137
+          paddingLeft: 5
138
+        },
139
+  
140
+  Bullet: { fontSize: 18,
141
+            textAlign: "left",
142
+            marginLeft: "6%",
143
+            marginTop: "2%",
144
+            flexDirection: 'row'
145
+          }
146
+});
25 147
 
26 148
 export default Analisis;

+ 2
- 1
screens/Drna.js Прегледај датотеку

@@ -27,7 +27,7 @@ const postData = (URL, data) => {
27 27
 };
28 28
 
29 29
 const Drna = () => {
30
-  const URL = "http://192.168.50.171:5000/complaints/add";
30
+  const URL = "http://192.168.7.178:5001/complaints/add";
31 31
   const [name, onChangeName] = React.useState(null);
32 32
   const [email, onChangeEmail] = React.useState(null);
33 33
   const [place, onChangePlace] = React.useState(null);
@@ -108,6 +108,7 @@ const Drna = () => {
108 108
             name: name,
109 109
             email: email,
110 110
             place: place,
111
+            complaint_status: "pending",
111 112
             complaint_type: selected.valueOf(),
112 113
             complaint_description: description,
113 114
           })

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

@@ -14,7 +14,7 @@ const Lista = () => {
14 14
 
15 15
   const getComplaints = async () => {
16 16
     try {
17
-      const response = await fetch("http://192.168.50.171:5000/complaints/all");
17
+      const response = await fetch("http://192.168.7.178:5001/complaints/all");
18 18
       const json = await response.json();
19 19
       setData(json.Complaints);
20 20
     } catch (error) {
@@ -40,7 +40,7 @@ const Lista = () => {
40 40
             <Text style={{ padding: 8 }}>
41 41
               ID:{item.id}, Tipo de denuncia: {item.complaint_type}, Hecha por:{" "}
42 42
               {item.name}, en el lugar: {item.place}, descripcion del problema:{" "}
43
-              {item.complaint_description}
43
+              {item.complaint_description}, estatus:{"En espera"}
44 44
             </Text>
45 45
           )}
46 46
         />