123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- import React, {useState, useEffect} from 'react';
- import { View, Image, Text, Button, ScrollView, Pressable, Linking,StyleSheet} from 'react-native';
- import {Picker, DataButton} from "./Datos"
- import Noticias from './Noticias';
- import { styles } from './styles';
-
- //actual application
-
- class App extends React.Component {
-
- //the text at the end of a page gets cut off if anyone knows how to fix that?
- vars = {
- welcome:
-
- <View style = {styles.containerbackground}>
- <ScrollView style={styles.scrollView}>
- <View style = {styles.container}>
- <Text style={styles.intro}>Bienvenido!</Text>
- </View>
-
- <View style = {styles.container}>
-
- <Text style={styles.sub}>Aquí podra mantenerse al tanto con las
- últimas noticias relacionadas al Censo y tener acceso a los
- los Demographic Data Profiles de cada municipio de
- Puerto Rico.
- </Text>
- </View>
-
- <View style = {styles.bottom}>
- <Text style={styles.intro2}>Contactenos:</Text>
- <Text style={styles.sub}>Prof: Hernando Mattei Torres
- <Button onPress={() => Linking.openURL('mailto:hernando.mattei@upr.edu') }
- title="e-mail" /></Text>
- <Text style={styles.sub}>Angelica Rosario Santos
- <Button onPress={() => Linking.openURL('mailto:angelica.rosario2@upr.edu') }
- title="e-mail" /></Text>
- <Text style={styles.sub}>Data from:</Text>
- <Image source={require('./census-logos.png')} />
- <Button onPress={() => Linking.openURL('https://data.census.gov/profile?q=United+States&g=0100000US') }
- title="United States Census page" />
- </View>
- </ScrollView>
- </View>,
-
-
- newsView:
- <View style = {styles.containerbackground}>
- <ScrollView style={styles.scrollView}>
- <View style = {styles.container}>
-
- <Text style={styles.intro}>Noticias</Text>
-
- <Image source={require('./Logo.jpeg')} />
-
- </View>
- </ScrollView>
-
- <Noticias />
- </View>,
-
- dataOp:
- <View style = {styles.containerbackground}>
- <ScrollView nestedScrollEnabled = {true} style={styles.scrollView}>
- <View style = {styles.container}>
- <Text style={styles.intro}>DATA VIEWING PROJECT</Text>
- </View>
-
-
- <Picker />
-
- <DataButton />
-
-
- </ScrollView>
-
- </View>
-
-
- }
-
-
- //current state
- state = {current: this.vars.welcome}
-
- //state changing functions
- setHome = () => this.setState({ current: this.vars.welcome })
-
-
- setData = () => this.setState({current: this.vars.dataOp})
-
-
- setNews = () => this.setState({ current: this.vars.newsView })
-
-
-
- //render app
- render() {
- return (
- <View>
- <View style = {styles.containerbackground}>
- <View style = {styles.buttonContainer}>
-
- <Text style={styles.Navsub}> Demographic Data Viewer</Text>
-
- <View style = {styles.navContainer}>
- <Pressable style={styles.buttons} onPress = {this.setNews}>
- <Text style={styles.text}> Noticias</Text>
- </Pressable>
-
- <Pressable style={styles.buttons} onPress = {this.setHome}>
- <Text style={styles.text}> Hogar</Text>
- </Pressable>
-
- <Pressable style={styles.buttons} onPress = {this.setData}>
- <Text style={styles.text}> Datos</Text>
- </Pressable>
-
- </View>
-
- {this.state.current}
-
- </View>
-
- </View>
-
- </View>
- );
- }
- }
-
-
- export default App
|