Browse Source

Cambios nuevos

Carla Ramos 2 years ago
parent
commit
0391c6ce32
2 changed files with 73 additions and 25 deletions
  1. 73
    25
      App.js
  2. BIN
      census-logos.png

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

BIN
census-logos.png View File