From b156bb651893b8fed805278e3bce54a0a969187b Mon Sep 17 00:00:00 2001 From: henrydays Date: Sat, 23 Mar 2019 19:03:56 +0000 Subject: [PATCH] up --- App/app/Router.js | 16 +- App/app/screens/Eventos.js | 292 ++++++++--------- App/app/screens/Profile.js | 1 + App/app/screens/choosePath.js | 183 ++++++++++- App/app/screens/event.js | 460 +++++++++++++++++++++++++++ App/app/screens/eventDetail.js | 3 +- App/app/store/actions/actionTypes.js | 1 + App/app/store/actions/api.js | 18 +- App/app/store/reducers/api.js | 7 +- 9 files changed, 824 insertions(+), 157 deletions(-) create mode 100644 App/app/screens/event.js diff --git a/App/app/Router.js b/App/app/Router.js index 4270a637..48a78858 100755 --- a/App/app/Router.js +++ b/App/app/Router.js @@ -43,12 +43,15 @@ import eventDetail from './screens/eventDetail'; import teamDetail from './screens/teamDetail'; +import event from './screens/event'; + const navigationOptions = ({navigation}) => ({ headerLeft: navigation.goBack(null)}/>, headerStyle: {backgroundColor: 'transparent', zIndex: 100 }, }); + const AppStack = createBottomTabNavigator( { Calendário: { @@ -62,7 +65,7 @@ const AppStack = createBottomTabNavigator( }, }, - 'Jogo do...': { + 'Jogo': { screen: Jogo, navigationOptions: { @@ -137,14 +140,14 @@ const Stack = createStackNavigator({ navigation.navigate('Profile')}> - Editar dados + Editar dados ) } } - if (navigation.state.routes[index].routeName == 'Jogo do...') { + if (navigation.state.routes[index].routeName == 'Jogo') { return { header: ( Jogo do ENEI'19 @@ -164,8 +167,8 @@ const Stack = createStackNavigator({ navigation.navigate('choosePath')}> - Inscrições - + Inscrições + ) @@ -225,6 +228,9 @@ const Stack = createStackNavigator({ resetPassword:{ screen:resetPassword + }, + event:{ + screen: event } }); diff --git a/App/app/screens/Eventos.js b/App/app/screens/Eventos.js index 830c2a68..a0a82768 100644 --- a/App/app/screens/Eventos.js +++ b/App/app/screens/Eventos.js @@ -1,184 +1,186 @@ import * as React from "react"; import { - View, - StyleSheet, - Dimensions, - Text, - Button, - ScrollView, - Image, - TouchableOpacity, - FlatList, - ActivityIndicator + View, + StyleSheet, + Dimensions, + Text, + Button, + ScrollView, + Image, + TouchableOpacity, + FlatList, + ActivityIndicator } from "react-native"; -import {TabView, TabBar, SceneMap} from "react-native-tab-view"; +import { TabView, TabBar, SceneMap } from "react-native-tab-view"; -import rallyImg from '../assets/rallyTascas.jpg'; +import rallyImg from "../assets/rallyTascas.jpg"; -import {connect} from "react-redux"; +import { connect } from "react-redux"; -import {bindActionCreators} from "redux"; +import { bindActionCreators } from "redux"; import * as Actions from "../store/actions"; //Import your actionss const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_WIDTH = Dimensions.get("window").width; - import PTRView from "react-native-pull-to-refresh"; class Eventos extends React.Component { - -_update=()=> { + _update = () => { this.props.getAllEvents(this.props.internalToken); - this.props.getEventLocsVisited(this.props.team.id,this.props.internalToken); -} - state = { - index: 0, - routes: [ - {key: "first", title: "Festarola"}, - {key: "second", title: "Febrada"}, - {key: "third", title: "Rally"}, - {key: "fourth", title: "Peddy"} - ] - }; + this.props.getEventLocsVisited( + this.props.team.id, + this.props.internalToken + ); + }; + state = { + index: 0, + routes: [ + { key: "first", title: "Festarola" }, + { key: "second", title: "Febrada" }, + { key: "third", title: "Rally" }, + { key: "fourth", title: "Peddy" } + ] + }; - componentDidMount() { - this.props.getAllEvents(this.props.internalToken); - this.props.getEventLocsVisited(this.props.team.id,this.props.internalToken); - } + componentDidMount() { + this.props.getAllEvents(this.props.internalToken); + this.props.getEventLocsVisited( + this.props.team.id, + this.props.internalToken + ); + } + render() { + const { navigate } = this.props.navigation; + return ( + + + {this.props.eventsInternal == undefined && ( + + + Se estiver a demorar muito, arrasta para atualizar + - render() { - const {navigate} = this.props.navigation; - return ( - - - - - { - this.props.eventsInternal==undefined && - - Se estiver a demorar muito, arrasta para atualizar -