|
@@ -1,8 +1,8 @@
|
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
|
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
|
7
|
//import JSON;
|
8
|
8
|
//import { Dataframe, readJSON } from "danfojs";
|
|
@@ -115,7 +115,7 @@ const styles = StyleSheet.create({
|
115
|
115
|
marginTop: 40,
|
116
|
116
|
marginBottom: 30,
|
117
|
117
|
margin: 30,
|
118
|
|
- borderColor: "grey",
|
|
118
|
+ borderColor: "white",
|
119
|
119
|
borderRadius: 8,
|
120
|
120
|
padding: (30, 16),
|
121
|
121
|
backgroundColor: "black",
|
|
@@ -123,11 +123,11 @@ const styles = StyleSheet.create({
|
123
|
123
|
},
|
124
|
124
|
buttonContainer: {
|
125
|
125
|
flexDirection: 'column',
|
126
|
|
- backgroundColor: '#f0f8ff',
|
|
126
|
+ backgroundColor: 'black',
|
127
|
127
|
alignItems: 'center',
|
128
|
128
|
justifyContent: 'center',
|
129
|
|
- paddingTop:100,
|
130
|
|
- marginTop: 20,
|
|
129
|
+ paddingTop:5,
|
|
130
|
+ marginTop: 30,
|
131
|
131
|
},
|
132
|
132
|
container: {
|
133
|
133
|
flexDirection: 'column',
|
|
@@ -147,6 +147,11 @@ const styles = StyleSheet.create({
|
147
|
147
|
color:"#black",
|
148
|
148
|
fontSize: 30,
|
149
|
149
|
},
|
|
150
|
+ intro2: {
|
|
151
|
+ fontWeight: "bold",
|
|
152
|
+ color:"#beb2c8",
|
|
153
|
+ fontSize: 20,
|
|
154
|
+},
|
150
|
155
|
|
151
|
156
|
sub: {
|
152
|
157
|
color:"#black",
|
|
@@ -160,6 +165,7 @@ const styles = StyleSheet.create({
|
160
|
165
|
fontWeight: "bold",
|
161
|
166
|
fontSize: 30,
|
162
|
167
|
paddingBottom:10,
|
|
168
|
+ alignItems: 'center',
|
163
|
169
|
},
|
164
|
170
|
scrollView:{
|
165
|
171
|
marginHorizontal: 20
|
|
@@ -194,7 +200,12 @@ const handlePress = () => false
|
194
|
200
|
//data parsing goes here
|
195
|
201
|
function getInfo(){
|
196
|
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
|
211
|
//data display
|
|
@@ -364,6 +375,8 @@ function Picker() {
|
364
|
375
|
|
365
|
376
|
</View>
|
366
|
377
|
);
|
|
378
|
+
|
|
379
|
+
|
367
|
380
|
}
|
368
|
381
|
|
369
|
382
|
|
|
@@ -371,21 +384,39 @@ function Picker() {
|
371
|
384
|
//actual application
|
372
|
385
|
|
373
|
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
|
407
|
welcome:
|
378
|
408
|
|
379
|
409
|
<View style = {styles.containerbackground}>
|
380
|
410
|
<ScrollView style={styles.scrollView}>
|
|
411
|
+ <View style = {styles.containerbackground}>
|
|
412
|
+
|
381
|
413
|
<View style = {styles.container}>
|
382
|
414
|
<Text style={styles.intro}>Bienvenido!</Text>
|
383
|
415
|
</View>
|
384
|
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
|
420
|
</View>
|
390
|
421
|
</ScrollView>
|
391
|
422
|
</View>,
|
|
@@ -400,7 +431,8 @@ vars = {
|
400
|
431
|
<Image source={require('./Logo.jpeg')} />
|
401
|
432
|
|
402
|
433
|
</View>
|
403
|
|
- </ScrollView></View>,
|
|
434
|
+ </ScrollView>
|
|
435
|
+ </View>,
|
404
|
436
|
|
405
|
437
|
dataOp:
|
406
|
438
|
<View style = {styles.containerbackground}>
|
|
@@ -416,6 +448,13 @@ vars = {
|
416
|
448
|
|
417
|
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
|
458
|
</View>
|
420
|
459
|
</ScrollView></View>
|
421
|
460
|
|
|
@@ -443,24 +482,33 @@ setNews = () => this.setState({ current: this.vars.newsView })
|
443
|
482
|
<View>
|
444
|
483
|
|
445
|
484
|
<View style = {styles.containerbackground}>
|
|
485
|
+ <ScrollView style={styles.scrollView}>
|
446
|
486
|
<View style = {styles.buttonContainer}>
|
447
|
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
|
491
|
<Button
|
450
|
|
- onPress = {this.setNews}
|
451
|
|
- title = "Noticias"
|
|
492
|
+ title = "Noticias"
|
452
|
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
|
509
|
{this.state.current}
|
463
|
510
|
</View>
|
|
511
|
+ </ScrollView>
|
464
|
512
|
</View>
|
465
|
513
|
</View>
|
466
|
514
|
);
|