Browse Source

Nuevos cambios

Carla Ramos 1 year ago
parent
commit
6aa5790ff7
5 changed files with 90 additions and 50 deletions
  1. 73
    25
      App.js
  2. BIN
      census-logos.png
  3. 11
    0
      package-lock.json
  4. 1
    0
      package.json
  5. 5
    25
      yarn.lock

+ 73
- 25
App.js View File

1
-import { StatusBar } from 'expo-status-bar';
2
-import React, {useState, useEffect} from 'react';
3
-import { View, Image, StyleSheet, Text, Button, ScrollView, Pressable} from 'react-native';
1
+import React, {useState, useEffect, Component} from 'react';
2
+import { View, Image, StyleSheet, Text, Button, ScrollView, Pressable, Linking} from 'react-native';
4
 import DropDownPicker from 'react-native-dropdown-picker';
3
 import DropDownPicker from 'react-native-dropdown-picker';
5
 import { Alert } from 'react-native';
4
 import { Alert } from 'react-native';
6
 
5
 
99
 	var query = queryBase + "(" + table + ")&for=county:" + pueblo + queryEnd 
98
 	var query = queryBase + "(" + table + ")&for=county:" + pueblo + queryEnd 
100
 	
99
 	
101
 	if(pueblo && table)
100
 	if(pueblo && table)
102
-	{loadDoc(query)}
101
+	{loadDoc(query);
102
+	if(information == ""){Alert.alert("No data response found.")}}
103
 	else
103
 	else
104
 	{Alert.alert("Please fill every parameter before calling!")}
104
 	{Alert.alert("Please fill every parameter before calling!")}
105
 	
105
 	
114
 	  marginTop: 40,
114
 	  marginTop: 40,
115
 	  marginBottom: 30,
115
 	  marginBottom: 30,
116
 	  margin: 30,
116
 	  margin: 30,
117
-	  borderColor: "grey",
117
+	  borderColor: "white",
118
 	  borderRadius: 8,
118
 	  borderRadius: 8,
119
 	  padding: (30, 16),
119
 	  padding: (30, 16),
120
 	  backgroundColor: "black",
120
 	  backgroundColor: "black",
122
   }, 
122
   }, 
123
   buttonContainer: {
123
   buttonContainer: {
124
     flexDirection: 'column',
124
     flexDirection: 'column',
125
-    backgroundColor: '#f0f8ff',
125
+    backgroundColor: 'black',
126
     alignItems: 'center',
126
     alignItems: 'center',
127
     justifyContent: 'center',
127
     justifyContent: 'center',
128
-	paddingTop:100,
129
-	marginTop: 20,
128
+	paddingTop:5,
129
+	marginTop: 30,
130
   },
130
   },
131
   container: {
131
   container: {
132
     flexDirection: 'column',
132
     flexDirection: 'column',
146
       color:"#black",
146
       color:"#black",
147
 	  fontSize: 30,
147
 	  fontSize: 30,
148
   },
148
   },
149
+  intro2: {
150
+	fontWeight: "bold",
151
+	color:"#beb2c8",
152
+	fontSize: 20,
153
+},
149
 
154
 
150
   sub: {
155
   sub: {
151
 	color:"#black",  
156
 	color:"#black",  
159
 	  fontWeight: "bold",
164
 	  fontWeight: "bold",
160
 	  fontSize: 30,
165
 	  fontSize: 30,
161
 	  paddingBottom:10,
166
 	  paddingBottom:10,
167
+	  alignItems: 'center',
162
   },
168
   },
163
   scrollView:{
169
   scrollView:{
164
 	  marginHorizontal: 20
170
 	  marginHorizontal: 20
193
 //data parsing goes here
199
 //data parsing goes here
194
 function getInfo(){
200
 function getInfo(){
195
 	//console.log(information[6])
201
 	//console.log(information[6])
196
-	return information
202
+	if(!information)
203
+	{Alert.alert("Please try again later! Error retriving data")}
204
+	else
205
+	{return information}
206
+
207
+	
197
 }
208
 }
198
 
209
 
199
 //data display
210
 //data display
363
 	
374
 	
364
 	</View>
375
 	</View>
365
   );
376
   );
377
+
378
+  
366
 }
379
 }
367
 
380
 
368
 
381
 
370
 //actual application
383
 //actual application
371
 
384
 
372
 class App extends React.Component {
385
 class App extends React.Component {
386
+	//Note: if prop-types could not be found within the project
387
+	//run on terminal "npm install --save proptypes"
388
+
389
+	// constructor(props) {
390
+	// 	super(props);
391
+	// 	this.setData = {
392
+	// 	  HeadTable: ['Head1', 'Head2', 'Head3', 'Head4', 'Head5'],
393
+	// 	  DataTable: [
394
+	// 		['1', '2', '3', '4', '5'],
395
+	// 		['a', 'b', 'c', 'd', 'e'],
396
+	// 		['1', '2', '3', '4', '5'],
397
+	// 		['a', 'b', 'c', 'd', 'e'],
398
+	// 		['1', '2', '3', '4', '5']
399
+	// 	  ]
400
+	// 	}
401
+	//   }
402
+	
373
 
403
 
374
-//the text at the end of a page gets cut off if anyone knows how to fix that?
375
-vars = {
404
+	//the text at the end of a page gets cut off if anyone knows how to fix that?
405
+	vars = {
376
 		welcome:
406
 		welcome:
377
 
407
 
378
 		<View style = {styles.containerbackground}>
408
 		<View style = {styles.containerbackground}>
379
 		<ScrollView style={styles.scrollView}>
409
 		<ScrollView style={styles.scrollView}>
410
+			<View style = {styles.containerbackground}>
411
+		
380
 		  	<View style = {styles.container}>
412
 		  	<View style = {styles.container}>
381
 				<Text style={styles.intro}>Bienvenido!</Text>
413
 				<Text style={styles.intro}>Bienvenido!</Text>
382
 			</View>
414
 			</View>
383
 			<View style = {styles.container}>
415
 			<View style = {styles.container}>
384
-				<Text style={styles.sub}>Aquí podra mantenerse al tanto con las 
385
-					últimas noticias relacionadas al Censo y tener acceso a los  
386
-					los Demographic Data Profiles de cada municipio de
387
-					Puerto Rico.</Text>
416
+				<Text style={styles.sub}>Aqui podra mantenerse al tanto con las 
417
+					ultimas noticias relacionadas al censo y tambien verificar 
418
+					las tablas por municipio.</Text>
388
 		   </View>
419
 		   </View>
389
 		  </ScrollView>
420
 		  </ScrollView>
390
 		</View>,
421
 		</View>,
399
 			<Image source={require('./Logo.jpeg')} />
430
 			<Image source={require('./Logo.jpeg')} />
400
 			
431
 			
401
 		 </View>
432
 		 </View>
402
-		</ScrollView></View>,
433
+		</ScrollView>
434
+		</View>,
403
 		
435
 		
404
 		dataOp:
436
 		dataOp:
405
 		<View style = {styles.containerbackground}>
437
 		<View style = {styles.containerbackground}>
415
 			
447
 			
416
 			<Text style={styles.sub}>blehhhhhh bleh bleh bleh bleh bleh blehhhhhhhhhhhhhhhhh </Text>
448
 			<Text style={styles.sub}>blehhhhhh bleh bleh bleh bleh bleh blehhhhhhhhhhhhhhhhh </Text>
417
 			
449
 			
450
+			<View style={styles.container}>
451
+      		{/* <Table borderStyle={{borderWidth: 1, borderColor: '#ffa1d2'}}>
452
+        	<Row data={state.HeadTable} style={styles.HeadStyle} textStyle={styles.TableText}/>
453
+        	<Rows data={state.DataTable} textStyle={styles.TableText}/>
454
+      	</Table> */}
455
+    </View>
456
+
418
 		 </View>
457
 		 </View>
419
 		</ScrollView></View>
458
 		</ScrollView></View>
420
 		
459
 		
442
 	  <View>
481
 	  <View>
443
 		
482
 		
444
 			<View style = {styles.containerbackground}>
483
 			<View style = {styles.containerbackground}>
484
+				<ScrollView style={styles.scrollView}>
445
 				<View style = {styles.buttonContainer}>
485
 				<View style = {styles.buttonContainer}>
446
 					<Text style={styles.Navsub}> Demographic Data Viewer</Text>
486
 					<Text style={styles.Navsub}> Demographic Data Viewer</Text>
447
-							<View style = {styles.buttons}>
487
+						<Text style={styles.sub}> Navegador</Text>
488
+							<Pressable style = {styles.buttons} onPress={this.setNews}>
489
+							
448
 			 		 			<Button
490
 			 		 			<Button
449
-								onPress = {this.setNews}
450
-				 				title = "Noticias"
491
+								title = "Noticias"
451
 				 				color = "white"
492
 				 				color = "white"
452
 			  					/>
493
 			  					/>
453
-			  					<Button
454
-								 onPress = {this.setData}
455
-								 title = "Datos"
456
-								 color = "white"
494
+			  
495
+			  					
496
+							</Pressable>
497
+								
498
+							<Pressable style = {styles.buttons} onPress={this.setData}>
499
+							
500
+			 		 			<Button
501
+								title = "Datos"
502
+				 				color = "white"
457
 			  					/>
503
 			  					/>
458
-							</View>
459
-						
504
+			  
505
+			  					
506
+							</Pressable>
460
 						
507
 						
461
 		  				{this.state.current}
508
 		  				{this.state.current}
462
 					</View>
509
 					</View>
510
+					</ScrollView>
463
 			</View>
511
 			</View>
464
 		</View>
512
 		</View>
465
       );
513
       );

BIN
census-logos.png View File


+ 11
- 0
package-lock.json View File

21
         "react-native": "0.70.5",
21
         "react-native": "0.70.5",
22
         "react-native-dropdown-picker": "^5.4.3",
22
         "react-native-dropdown-picker": "^5.4.3",
23
         "react-native-element-dropdown": "^2.5.0",
23
         "react-native-element-dropdown": "^2.5.0",
24
+        "react-native-table-component": "^1.2.2",
24
         "react-native-web": "~0.18.9"
25
         "react-native-web": "~0.18.9"
25
       },
26
       },
26
       "devDependencies": {
27
       "devDependencies": {
15482
       "integrity": "sha512-oOanj84fJEXUg9FoEAQomA8ISG+DVIrTZ3qF7m69VQUJyOGYyDZmPqKcjvRku4KXlEH6hWO9i4ACLzNBh8gC0A==",
15483
       "integrity": "sha512-oOanj84fJEXUg9FoEAQomA8ISG+DVIrTZ3qF7m69VQUJyOGYyDZmPqKcjvRku4KXlEH6hWO9i4ACLzNBh8gC0A==",
15483
       "license": "MIT"
15484
       "license": "MIT"
15484
     },
15485
     },
15486
+    "node_modules/react-native-table-component": {
15487
+      "version": "1.2.2",
15488
+      "resolved": "https://registry.npmjs.org/react-native-table-component/-/react-native-table-component-1.2.2.tgz",
15489
+      "integrity": "sha512-7bbsi5431iWcjj3toASh8lFHGi6AG/+MTd4M7GuksXKxx/CFs/Qwv1Ys7D2wgyuYKe3hxWNfSVrteFj0tOYXYw=="
15490
+    },
15485
     "node_modules/react-native-web": {
15491
     "node_modules/react-native-web": {
15486
       "version": "0.18.10",
15492
       "version": "0.18.10",
15487
       "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.18.10.tgz",
15493
       "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.18.10.tgz",
31873
       "resolved": "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz",
31879
       "resolved": "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz",
31874
       "integrity": "sha512-oOanj84fJEXUg9FoEAQomA8ISG+DVIrTZ3qF7m69VQUJyOGYyDZmPqKcjvRku4KXlEH6hWO9i4ACLzNBh8gC0A=="
31880
       "integrity": "sha512-oOanj84fJEXUg9FoEAQomA8ISG+DVIrTZ3qF7m69VQUJyOGYyDZmPqKcjvRku4KXlEH6hWO9i4ACLzNBh8gC0A=="
31875
     },
31881
     },
31882
+    "react-native-table-component": {
31883
+      "version": "1.2.2",
31884
+      "resolved": "https://registry.npmjs.org/react-native-table-component/-/react-native-table-component-1.2.2.tgz",
31885
+      "integrity": "sha512-7bbsi5431iWcjj3toASh8lFHGi6AG/+MTd4M7GuksXKxx/CFs/Qwv1Ys7D2wgyuYKe3hxWNfSVrteFj0tOYXYw=="
31886
+    },
31876
     "react-native-web": {
31887
     "react-native-web": {
31877
       "version": "0.18.10",
31888
       "version": "0.18.10",
31878
       "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.18.10.tgz",
31889
       "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.18.10.tgz",

+ 1
- 0
package.json View File

22
     "react-native": "0.70.5",
22
     "react-native": "0.70.5",
23
     "react-native-dropdown-picker": "^5.4.3",
23
     "react-native-dropdown-picker": "^5.4.3",
24
     "react-native-element-dropdown": "^2.5.0",
24
     "react-native-element-dropdown": "^2.5.0",
25
+    "react-native-table-component": "^1.2.2",
25
     "react-native-web": "~0.18.9"
26
     "react-native-web": "~0.18.9"
26
   },
27
   },
27
   "devDependencies": {
28
   "devDependencies": {

+ 5
- 25
yarn.lock View File

2799
   "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz"
2799
   "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz"
2800
   "version" "2.2.0"
2800
   "version" "2.2.0"
2801
 
2801
 
2802
-"bindings@^1.5.0":
2803
-  "integrity" "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ=="
2804
-  "resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
2805
-  "version" "1.5.0"
2806
-  dependencies:
2807
-    "file-uri-to-path" "1.0.0"
2808
-
2809
 "bl@^4.1.0":
2802
 "bl@^4.1.0":
2810
   "integrity" "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="
2803
   "integrity" "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="
2811
   "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
2804
   "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
5401
   "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
5394
   "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
5402
   "version" "1.0.0"
5395
   "version" "1.0.0"
5403
 
5396
 
5404
-"fsevents@^1.2.7":
5405
-  "integrity" "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw=="
5406
-  "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz"
5407
-  "version" "1.2.13"
5408
-  dependencies:
5409
-    "bindings" "^1.5.0"
5410
-    "nan" "^2.12.1"
5411
-
5412
-"fsevents@^2.1.2", "fsevents@~2.3.2":
5413
-  "integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
5414
-  "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
5415
-  "version" "2.3.2"
5416
-
5417
 "function-bind@^1.1.1":
5397
 "function-bind@^1.1.1":
5418
   "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
5398
   "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
5419
   "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
5399
   "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
7663
     "object-assign" "^4.0.1"
7643
     "object-assign" "^4.0.1"
7664
     "thenify-all" "^1.0.0"
7644
     "thenify-all" "^1.0.0"
7665
 
7645
 
7666
-"nan@^2.12.1":
7667
-  "integrity" "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ=="
7668
-  "resolved" "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz"
7669
-  "version" "2.17.0"
7670
-
7671
 "nanomatch@^1.2.9":
7646
 "nanomatch@^1.2.9":
7672
   "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA=="
7647
   "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA=="
7673
   "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz"
7648
   "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz"
9091
   "resolved" "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz"
9066
   "resolved" "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.70.3.tgz"
9092
   "version" "0.70.3"
9067
   "version" "0.70.3"
9093
 
9068
 
9069
+"react-native-table-component@^1.2.2":
9070
+  "integrity" "sha512-7bbsi5431iWcjj3toASh8lFHGi6AG/+MTd4M7GuksXKxx/CFs/Qwv1Ys7D2wgyuYKe3hxWNfSVrteFj0tOYXYw=="
9071
+  "resolved" "https://registry.npmjs.org/react-native-table-component/-/react-native-table-component-1.2.2.tgz"
9072
+  "version" "1.2.2"
9073
+
9094
 "react-native-web@~0.18.9":
9074
 "react-native-web@~0.18.9":
9095
   "integrity" "sha512-YV2gtZa1n7ulTGp+HcxH+KsAtaDPBI/dKd9oOQS31zyFHURjObLUVkKnGjkmlYAUReWfvmlU64GzyNwoZF9/tA=="
9075
   "integrity" "sha512-YV2gtZa1n7ulTGp+HcxH+KsAtaDPBI/dKd9oOQS31zyFHURjObLUVkKnGjkmlYAUReWfvmlU64GzyNwoZF9/tA=="
9096
   "resolved" "https://registry.npmjs.org/react-native-web/-/react-native-web-0.18.10.tgz"
9076
   "resolved" "https://registry.npmjs.org/react-native-web/-/react-native-web-0.18.10.tgz"