ENEI2019-Public/App/app/screens/Eventos.js

147 lines
3.7 KiB
JavaScript
Raw Normal View History

2019-03-10 00:00:54 +00:00
import * as React from "react";
2019-03-13 20:23:59 +00:00
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, Image, TouchableOpacity} from "react-native";
2019-03-11 18:11:51 +00:00
import {TabView, TabBar, SceneMap} from "react-native-tab-view";
2019-03-12 22:51:17 +00:00
import rallyImg from '../assets/rallyTascas.jpg';
2019-03-11 18:11:51 +00:00
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
2019-02-06 23:24:00 +00:00
2019-03-12 22:51:17 +00:00
2019-02-06 23:24:00 +00:00
const FirstRoute = () => (
2019-03-11 18:11:51 +00:00
<View style={[styles.scene, {backgroundColor: "#ff4081"}]}/>
2019-02-06 23:24:00 +00:00
);
const SecondRoute = () => (
2019-03-11 18:11:51 +00:00
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
2019-02-06 23:24:00 +00:00
);
2019-02-07 17:29:45 +00:00
const ThirdRoute = () => (
2019-03-11 18:11:51 +00:00
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
2019-02-07 17:29:45 +00:00
);
const FourthRoute = () => (
2019-03-11 18:11:51 +00:00
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
2019-02-07 17:29:45 +00:00
);
2019-03-11 18:11:51 +00:00
2019-03-10 00:00:54 +00:00
export default class Eventos extends React.Component {
2019-03-11 18:11:51 +00:00
state = {
index: 0,
routes: [
{key: "first", title: "Festarola"},
{key: "second", title: "Febrada"},
{key: "third", title: "Rally"},
{key: "fourth", title: "Peddy"}
]
};
2019-03-13 20:23:59 +00:00
renderFebrada = (navigate) => {
2019-03-11 18:11:51 +00:00
return (
<View>
2019-03-13 20:23:59 +00:00
<TouchableOpacity onPress={() => navigate('FebradaDetail')}>
2019-03-13 01:07:27 +00:00
<View style={styles.cardContainer}>
<Image
2019-03-12 22:51:17 +00:00
style={{
flex: 1,
2019-03-13 01:07:27 +00:00
width: undefined,
height: undefined
2019-03-12 22:51:17 +00:00
}}
2019-03-13 01:07:27 +00:00
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
2019-03-11 19:16:10 +00:00
</View>
2019-03-13 20:23:59 +00:00
</TouchableOpacity>
2019-03-11 18:11:51 +00:00
</View>
);
};
renderRally = () => {
2019-03-13 01:07:27 +00:00
return (
<View>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
</View>
);
2019-03-11 18:11:51 +00:00
};
renderCaching = () => {
return (
2019-03-11 19:16:10 +00:00
<View>
2019-03-13 01:07:27 +00:00
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
2019-03-11 18:11:51 +00:00
2019-03-13 01:07:27 +00:00
</View>
);
2019-03-11 18:11:51 +00:00
};
render() {
2019-03-13 20:23:59 +00:00
const {navigate} = this.props.navigation;
2019-03-11 18:11:51 +00:00
return (
<View style={styles.container}>
<ScrollView styles={styles.scroll}>
2019-03-13 20:23:59 +00:00
{this.renderFebrada(navigate)}
2019-03-13 01:07:27 +00:00
{this.renderRally()}
{this.renderCaching()}
2019-03-11 18:11:51 +00:00
</ScrollView>
</View>
);
}
2019-01-30 14:32:25 +00:00
}
const styles = StyleSheet.create({
2019-03-11 18:11:51 +00:00
container: {
backgroundColor: '#eee',
flex: 1,
2019-03-13 01:07:27 +00:00
flexGrow: 1,
flexDirection: 'column',
2019-03-11 18:11:51 +00:00
},
2019-03-13 01:07:27 +00:00
2019-03-11 18:11:51 +00:00
scroll: {
2019-03-11 19:16:10 +00:00
flex: 1,
2019-03-11 18:11:51 +00:00
},
cardContainer: {
flex: 1,
2019-03-12 22:51:17 +00:00
flexDirection: 'row',
2019-03-11 18:11:51 +00:00
padding: 10,
margin: 20,
2019-03-11 19:16:10 +00:00
backgroundColor: '#fff',
2019-03-13 01:07:27 +00:00
height: SCREEN_WIDTH * (1 / 2),
2019-03-11 18:11:51 +00:00
borderRadius: 5,
2019-03-13 01:07:27 +00:00
//borderWidth: 2,
2019-03-11 18:11:51 +00:00
},
scene: {
flex: 1
}
2019-03-10 00:00:54 +00:00
});