Browse Source

Changes colors and styles in app

Carla Ramos 1 year ago
parent
commit
504d39d366
2 changed files with 73 additions and 44 deletions
  1. 48
    44
      App.js
  2. 25
    0
      yarn.lock

+ 48
- 44
App.js View File

2
 import React, {useState, useEffect} from 'react';
2
 import React, {useState, useEffect} from 'react';
3
 import { View, Image, StyleSheet, Text, Button, ScrollView, Pressable} from 'react-native';
3
 import { View, Image, StyleSheet, Text, Button, ScrollView, Pressable} from 'react-native';
4
 import DropDownPicker from 'react-native-dropdown-picker';
4
 import DropDownPicker from 'react-native-dropdown-picker';
5
-import { parse } from 'json2csv';
5
+
6
 
6
 
7
 //import JSON;
7
 //import JSON;
8
 //import { Dataframe, readJSON } from "danfojs";
8
 //import { Dataframe, readJSON } from "danfojs";
19
 
19
 
20
 function organize(){
20
 function organize(){
21
 	
21
 	
22
-	var stringDiv = JSON.parse(information)
23
-	var csv = parse(stringDiv)
24
-	console.log(csv)
22
+	var stringDiv = JSON.stringify(information)
23
+	stringDiv = stringDiv.replace('[[', '');
24
+	stringDiv = stringDiv.replace(']]', '');
25
+	stringDiv = stringDiv.split(',')
26
+	//create smaller array variables
27
+	let variables = []
28
+	let value = []
29
+	let est = []
30
+	
31
+	
32
+	//theres a better way to do this but im not fixing it rn
33
+	for(let i = 0; i<stringDiv.length; i++){
34
+		if(i<stringDiv.length/3)
35
+		{variables.push(stringDiv[i])}
36
+		else if(i<stringDiv.length/3*2)
37
+		{value.push(stringDiv[i])}
38
+		else{est.push(stringDiv[i])}
39
+	}
40
+	
41
+	//anyways this to format it
25
 	
42
 	
26
-	//var csv is the variable with the thing you just pulled
27
-	//put function and data cleaning here
28
-	//just make sure you change the return value in 'getInfo()'
29
-	//so it returns the actual organized table
30
-	//or make getInfo() organize the table as well
31
-	//and return that organized table
32
-	//i leave this to you
43
+	console.log("vars:",variables)
44
+	console.log("val:",value)
45
+	console.log("est:",est)
46
+	//organizedData = JSON.parse(information)
47
+	//console.log(stringDiv)
33
 	
48
 	
34
 }
49
 }
35
 
50
 
51
+function json_2_csv(information){
52
+	const csv = parse(obj);
53
+
54
+	console.log(csv);
55
+}
56
+
36
 //fix
57
 //fix
37
 
58
 
38
 DropDownPicker.setListMode("SCROLLVIEW")
59
 DropDownPicker.setListMode("SCROLLVIEW")
97
 	  borderColor: "grey",
118
 	  borderColor: "grey",
98
 	  borderRadius: 8,
119
 	  borderRadius: 8,
99
 	  padding: (30, 16),
120
 	  padding: (30, 16),
100
-	  backgroundColor: "#008CBA",
121
+	  backgroundColor: "black",
101
 	  marginTop: 0
122
 	  marginTop: 0
102
   }, 
123
   }, 
103
   buttonContainer: {
124
   buttonContainer: {
104
     flexDirection: 'column',
125
     flexDirection: 'column',
105
-    backgroundColor: 'black',
126
+    backgroundColor: '#f0f8ff',
106
     alignItems: 'center',
127
     alignItems: 'center',
107
     justifyContent: 'center',
128
     justifyContent: 'center',
108
 	paddingTop:100,
129
 	paddingTop:100,
111
   container: {
132
   container: {
112
     flexDirection: 'column',
133
     flexDirection: 'column',
113
 	justifyContent: 'center',
134
 	justifyContent: 'center',
114
-    backgroundColor: 'black',
135
+    backgroundColor: '#f0f8ff',
115
     alignItems: 'center',
136
     alignItems: 'center',
116
     justifyContent: 'center',
137
     justifyContent: 'center',
117
 	paddingTop:20,
138
 	paddingTop:20,
119
   },
140
   },
120
   containerbackground:{
141
   containerbackground:{
121
 	
142
 	
122
-    backgroundColor: '#063970'
143
+    backgroundColor: '#f0f8ff'
123
   },
144
   },
124
   intro: {
145
   intro: {
125
 	  fontWeight: "bold",
146
 	  fontWeight: "bold",
126
-      color:"#beb2c8",
147
+      color:"#black",
127
 	  fontSize: 30,
148
 	  fontSize: 30,
128
   },
149
   },
129
 
150
 
130
   sub: {
151
   sub: {
131
-	color:"#beb2c8",  
152
+	color:"#black",  
132
 	fontWeight: "bold",
153
 	fontWeight: "bold",
133
 	fontSize: 15,
154
 	fontSize: 15,
134
 	paddingBottom:10,
155
 	paddingBottom:10,
135
 },
156
 },
136
 
157
 
137
   Navsub: {
158
   Navsub: {
138
-      color:"#beb2c8",  
159
+      color:"#black",  
139
 	  fontWeight: "bold",
160
 	  fontWeight: "bold",
140
 	  fontSize: 30,
161
 	  fontSize: 30,
141
 	  paddingBottom:10,
162
 	  paddingBottom:10,
164
 });
185
 });
165
 
186
 
166
 
187
 
188
+
167
 //default button press
189
 //default button press
168
 
190
 
169
 const handlePress = () => false
191
 const handlePress = () => false
303
 	{label: 'Yauco', value: '153'}
325
 	{label: 'Yauco', value: '153'}
304
   ]);
326
   ]);
305
   
327
   
306
-  //add a thing here to select year to take info from
307
-  
308
-
309
-//add a dropdown in here 
310
 
328
 
311
   return (
329
   return (
312
   <View>
330
   <View>
344
 	  searchPlaceholder="Busqueda..."
362
 	  searchPlaceholder="Busqueda..."
345
     />
363
     />
346
 	
364
 	
347
-	
348
-	
349
 	</View>
365
 	</View>
350
   );
366
   );
351
 }
367
 }
359
 //the text at the end of a page gets cut off if anyone knows how to fix that?
375
 //the text at the end of a page gets cut off if anyone knows how to fix that?
360
 vars = {
376
 vars = {
361
 		welcome:
377
 		welcome:
362
-		  
363
 
378
 
364
 		<View style = {styles.containerbackground}>
379
 		<View style = {styles.containerbackground}>
365
 		<ScrollView style={styles.scrollView}>
380
 		<ScrollView style={styles.scrollView}>
366
 		  	<View style = {styles.container}>
381
 		  	<View style = {styles.container}>
367
-		  
368
-		  
369
-				<Text style={styles.intro}>BIENVENIDO!!!!</Text>
370
-	
371
-				<Image source={require('./Logo.jpeg')} />
382
+				<Text style={styles.intro}>Bienvenido!</Text>
372
 			</View>
383
 			</View>
373
 			<View style = {styles.container}>
384
 			<View style = {styles.container}>
374
-				<Text style={styles.sub}>Aqui podra mantenerse al tanto con las 
375
-					ultimas noticias relacionadas al censo y tambien verificar 
376
-					las tablas por municipio.</Text>
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>
377
 		   </View>
389
 		   </View>
378
 		  </ScrollView>
390
 		  </ScrollView>
379
 		</View>,
391
 		</View>,
386
 			<Text style={styles.intro}>Noticias</Text>
398
 			<Text style={styles.intro}>Noticias</Text>
387
 			
399
 			
388
 			<Image source={require('./Logo.jpeg')} />
400
 			<Image source={require('./Logo.jpeg')} />
389
-		  
390
-			 
391
-			
392
 			
401
 			
393
 		 </View>
402
 		 </View>
394
 		</ScrollView></View>,
403
 		</ScrollView></View>,
398
 		<ScrollView nestedScrollEnabled = {true} style={styles.scrollView}>
407
 		<ScrollView nestedScrollEnabled = {true} style={styles.scrollView}>
399
 		 <View style = {styles.container}>
408
 		 <View style = {styles.container}>
400
 			
409
 			
401
-		  
402
 			<Text style={styles.intro}>DATA VIEWING PROJECT</Text>		
410
 			<Text style={styles.intro}>DATA VIEWING PROJECT</Text>		
403
 				
411
 				
404
 			<Picker />
412
 			<Picker />
405
-			
406
-			<Image source={require('./testimg.gif')} />
413
+
407
 				
414
 				
408
 			<DataButton />
415
 			<DataButton />
409
 			
416
 			
438
 			<View style = {styles.containerbackground}>
445
 			<View style = {styles.containerbackground}>
439
 				<View style = {styles.buttonContainer}>
446
 				<View style = {styles.buttonContainer}>
440
 					<Text style={styles.Navsub}> Demographic Data Viewer</Text>
447
 					<Text style={styles.Navsub}> Demographic Data Viewer</Text>
441
-						<Text style={styles.sub}> Navegador</Text>
442
 							<View style = {styles.buttons}>
448
 							<View style = {styles.buttons}>
443
-							
444
 			 		 			<Button
449
 			 		 			<Button
445
 								onPress = {this.setNews}
450
 								onPress = {this.setNews}
446
 				 				title = "Noticias"
451
 				 				title = "Noticias"
447
-				 				color = "rgba(255, 0, 0, 0)"
452
+				 				color = "white"
448
 			  					/>
453
 			  					/>
449
-			  
450
 			  					<Button
454
 			  					<Button
451
 								 onPress = {this.setData}
455
 								 onPress = {this.setData}
452
 								 title = "Datos"
456
 								 title = "Datos"
453
-								 color = "rgba(255, 0, 0, 0)"
457
+								 color = "white"
454
 			  					/>
458
 			  					/>
455
 							</View>
459
 							</View>
456
 						
460
 						

+ 25
- 0
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
+
2802
 "bl@^4.1.0":
2809
 "bl@^4.1.0":
2803
   "integrity" "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="
2810
   "integrity" "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="
2804
   "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
2811
   "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
5394
   "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
5401
   "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
5395
   "version" "1.0.0"
5402
   "version" "1.0.0"
5396
 
5403
 
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
+
5397
 "function-bind@^1.1.1":
5417
 "function-bind@^1.1.1":
5398
   "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
5418
   "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
5399
   "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
5419
   "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
7643
     "object-assign" "^4.0.1"
7663
     "object-assign" "^4.0.1"
7644
     "thenify-all" "^1.0.0"
7664
     "thenify-all" "^1.0.0"
7645
 
7665
 
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
+
7646
 "nanomatch@^1.2.9":
7671
 "nanomatch@^1.2.9":
7647
   "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA=="
7672
   "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA=="
7648
   "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz"
7673
   "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz"