No Description

App.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. import React, {useState, useEffect} from 'react';
  2. import { View, Image, Text, Button, ScrollView, Pressable, Linking,StyleSheet} from 'react-native';
  3. import {Picker, DataButton} from "./Datos"
  4. <<<<<<< HEAD
  5. import { styles } from './styles';
  6. =======
  7. import Noticias from './Noticias';
  8. import { styles } from './styles';
  9. >>>>>>> Prawject_UserSt1
  10. //actual application
  11. class App extends React.Component {
  12. //the text at the end of a page gets cut off if anyone knows how to fix that?
  13. vars = {
  14. welcome:
  15. <View style = {styles.containerbackground}>
  16. <ScrollView style={styles.scrollView}>
  17. <View style = {styles.container}>
  18. <Text style={styles.intro}>Bienvenido!</Text>
  19. </View>
  20. <View style = {styles.container}>
  21. <Text style={styles.sub}>Aquí podra mantenerse al tanto con las
  22. últimas noticias relacionadas al Censo y tener acceso a los
  23. los Demographic Data Profiles de cada municipio de
  24. Puerto Rico.
  25. </Text>
  26. </View>
  27. <View style = {styles.bottom}>
  28. <Text style={styles.intro2}>Contactenos:</Text>
  29. <Text style={styles.sub}>Prof: Hernando Mattei Torres
  30. <Button onPress={() => Linking.openURL('mailto:hernando.mattei@upr.edu') }
  31. title="e-mail" /></Text>
  32. <Text style={styles.sub}>Angelica Rosario Santos
  33. <Button onPress={() => Linking.openURL('mailto:angelica.rosario2@upr.edu') }
  34. title="e-mail" /></Text>
  35. <Text style={styles.sub}>Data from:</Text>
  36. <Image source={require('./census-logos.png')} />
  37. <Button onPress={() => Linking.openURL('https://data.census.gov/profile?q=United+States&g=0100000US') }
  38. title="United States Census page" />
  39. </View>
  40. </ScrollView>
  41. </View>,
  42. newsView:
  43. <View style = {styles.containerbackground}>
  44. <ScrollView style={styles.scrollView}>
  45. <View style = {styles.container}>
  46. <Text style={styles.intro}>Noticias</Text>
  47. <Image source={require('./Logo.jpeg')} />
  48. <<<<<<< HEAD
  49. </View>
  50. </ScrollView>
  51. =======
  52. </View>
  53. </ScrollView>
  54. <Noticias />
  55. >>>>>>> Prawject_UserSt1
  56. </View>,
  57. dataOp:
  58. <View style = {styles.containerbackground}>
  59. <ScrollView nestedScrollEnabled = {true} style={styles.scrollView}>
  60. <View style = {styles.container}>
  61. <Text style={styles.intro}>DATA VIEWING PROJECT</Text>
  62. </View>
  63. <Picker />
  64. <DataButton />
  65. </ScrollView>
  66. </View>
  67. }
  68. //current state
  69. state = {current: this.vars.welcome}
  70. //state changing functions
  71. setHome = () => this.setState({ current: this.vars.welcome })
  72. setData = () => this.setState({current: this.vars.dataOp})
  73. setNews = () => this.setState({ current: this.vars.newsView })
  74. //render app
  75. render() {
  76. return (
  77. <View>
  78. <View style = {styles.containerbackground}>
  79. <View style = {styles.buttonContainer}>
  80. <Text style={styles.Navsub}> Demographic Data Viewer</Text>
  81. <View style = {styles.navContainer}>
  82. <Pressable style={styles.buttons} onPress = {this.setNews}>
  83. <Text style={styles.text}> Noticias</Text>
  84. </Pressable>
  85. <Pressable style={styles.buttons} onPress = {this.setHome}>
  86. <Text style={styles.text}> Hogar</Text>
  87. </Pressable>
  88. <Pressable style={styles.buttons} onPress = {this.setData}>
  89. <Text style={styles.text}> Datos</Text>
  90. </Pressable>
  91. </View>
  92. {this.state.current}
  93. </View>
  94. </View>
  95. </View>
  96. );
  97. }
  98. }
  99. export default App