From ce8d7ed01d3620d07ca6bac0b21e176ee20503cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Borges?= Date: Mon, 18 Mar 2019 16:44:41 +0000 Subject: [PATCH] comm --- App/app/screens/Home.js | 783 +++++++++++++++++---------------- App/app/screens/rallyDetail.js | 46 ++ App/app/screens/rallyTascas.js | 2 +- 3 files changed, 446 insertions(+), 385 deletions(-) create mode 100644 App/app/screens/rallyDetail.js diff --git a/App/app/screens/Home.js b/App/app/screens/Home.js index d3e9d4db..ccd53869 100755 --- a/App/app/screens/Home.js +++ b/App/app/screens/Home.js @@ -1,429 +1,444 @@ -import React, { Component } from "react"; +import React, {Component} from "react"; import { - Button, - View, - Text, - TouchableOpacity, - FlatList, - ActivityIndicator, - Dimensions, - StyleSheet, - Image, - ImageBackground, - NetInfo, - AppState + Button, + View, + Text, + TouchableOpacity, + FlatList, + ActivityIndicator, + Dimensions, + StyleSheet, + Image, + ImageBackground, + NetInfo, + AppState } from "react-native"; -import { Shadow } from "react-native-shadow"; +import {Shadow} from "react-native-shadow"; import Icon from "react-native-vector-icons/Ionicons"; -import { RkButton, RkTheme } from "react-native-ui-kitten"; +import {RkButton, RkTheme} from "react-native-ui-kitten"; -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 import ImageOverlay from "react-native-image-overlay"; -import { createStore } from "redux"; +import {createStore} from "redux"; import PTRView from "react-native-pull-to-refresh"; -import { Provider } from "react-redux"; -import { ScrollView } from "react-native-gesture-handler"; +import {Provider} from "react-redux"; +import {ScrollView} from "react-native-gesture-handler"; + const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_WIDTH = Dimensions.get("window").width; -import { Card, Divider } from "react-native-elements"; +import {Card, Divider} from "react-native-elements"; import RNMaterialShadows from "react-native-material-shadows"; import IconFA from "react-native-vector-icons/FontAwesome5"; class Home extends Component { - _handleConnectionChange = isConnected => { - // this.props.dispatch(connectionState({ status: isConnected })); - console.log("fck that"); - }; - _refresh() { - return new Promise(resolve => { - setTimeout(() => { - resolve(); - }, 2000); - }); - } - _callApi() { - this.props.getUserInfo(this.props.token); - } - constructor(props) { - super(props); - - this.state = { - token: { valid: false }, - logged: true, - onHold: true, - user: { Name: "" }, - userDetails: {}, - appState: AppState.currentState + _handleConnectionChange = isConnected => { + // this.props.dispatch(connectionState({ status: isConnected })); + console.log("fck that"); }; - } - handleConnectivityChange = () => { - console.log("asdasdasdasdasd"); - }; - componentDidMount() { - // NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); - - // this.props.hold(); - console.log("hold" + this.props.onHold); - //this.props.logoutUser(); - - //console.log(this.props.token); - - this.props.getUserInfo(this.props.userDetails.token); - - //console.log('logged:'+this.props.logged); - - //console.log(th2is.props) - } - componentWillUnmount() {} - - bClick() { - //this.props.logoutUser(); - - let a = {}; - // this.setState({ user: this.props.user }); - // console.log(this.props.user) - // - - //var navigate = this.props.navigation.navigate - } - _update = () => { - this.props.getUserInfo(this.props.userDetails.token); - }; - - render() { - const { navigate } = this.props.navigation; - - if (this.props.onHold) { - return ( - - lollsss {this.props.onHold} - - - ); + _refresh() { + return new Promise(resolve => { + setTimeout(() => { + resolve(); + }, 2000); + }); } - if (this.props.logged) { - return ( - - - - - - - - - {this.props.user != undefined && ( - {this.props.user.Name} - )} - - {this.props.user.Company} - - - - - - - Informações Importantes - - - - Grupo de .... - Alojamento - - - - - - - - - Os tones - - - 5/6 elementos - - - - - Adicionar - - - - - - - - - - - Henrique Dias - AFFJASDXZ - - - - - rm equipa - - - - - - - - - Henrique Dias - AFFJASDXZ - - - - - remover - - - - - - - - - Henrique Dias - AFFJASDXZ - - - - - remover - - - - - - - - - Henrique Dias - AFFJASDXZ - - - - - remover - - - - - - - - - Henrique Dias - AFFJASDXZ - - - - - remover - - - - - - - - - - - - ); - } else { - return ( - - sem permissões para aceder aqui - - ); + _callApi() { + this.props.getUserInfo(this.props.token); + } + + constructor(props) { + super(props); + + this.state = { + token: {valid: false}, + logged: true, + onHold: true, + user: {Name: ""}, + userDetails: {}, + appState: AppState.currentState + }; + } + + handleConnectivityChange = () => { + console.log("asdasdasdasdasd"); + }; + + componentDidMount() { + // NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); + + // this.props.hold(); + console.log("hold" + this.props.onHold); + //this.props.logoutUser(); + + //console.log(this.props.token); + + this.props.getUserInfo(this.props.userDetails.token); + + //console.log('logged:'+this.props.logged); + + //console.log(th2is.props) + } + + componentWillUnmount() { + } + + bClick() { + //this.props.logoutUser(); + + let a = {}; + // this.setState({ user: this.props.user }); + // console.log(this.props.user) + // + + //var navigate = this.props.navigation.navigate + } + + _update = () => { + this.props.getUserInfo(this.props.userDetails.token); + }; + + + /*_removeMember = (membro.id) => { + + };*/ + + render() { + const {navigate} = this.props.navigation; + + if (this.props.onHold) { + return ( + + lollsss {this.props.onHold} + + + ); + } + if (this.props.logged) { + return ( + + + + + + + + + {this.props.user != undefined && ( + {this.props.user.Name} + )} + + {this.props.user.Company} + + + + + + + Informações Importantes + + + + Grupo de .... + Alojamento + + + + + + + + + Os tones + + + 5/6 elementos + + + + + Adicionar + + + + + + + + + + + Henrique Dias + AFFJASDXZ + + + this._removeMember(membro.id)}*/> + + rm equipa + + + + + + + + + Henrique Dias + AFFJASDXZ + + + + + remover + + + + + + + + + Henrique Dias + AFFJASDXZ + + + + + remover + + + + + + + + + Henrique Dias + AFFJASDXZ + + + + + remover + + + + + + + + + Henrique Dias + AFFJASDXZ + + + + + remover + + + + + + + + + + + + ); + } else { + return ( + + sem permissões para aceder aqui + + ); + } } - } } const styles = StyleSheet.create({ - userName:{ - fontSize:16, - fontWeight:'bold' + userName: { + fontSize: 16, + fontWeight: 'bold' }, - userRemove: { - alignContent: "center", - alignItems: "center", - - alignSelf:'center' - }, - userT: { - margin: 10, + userRemove: { + alignContent: "center", + alignItems: "center", - width: "55%", - // backgroundColor: "red" - }, - userLogo: { - paddingLeft: 10, + alignSelf: 'center' + }, + userT: { + margin: 10, - margin: 10 - }, - user: { - alignSelf: "center", - flex: 1, - flexDirection: "row", + width: "55%", + // backgroundColor: "red" + }, + userLogo: { + paddingLeft: 10, - margin: 10, + margin: 10 + }, + user: { + alignSelf: "center", + flex: 1, + flexDirection: "row", - marginTop: 5, - width: "100%" - }, - userBoxText: { - color: "white", - fontWeight: "bold" - }, - userStatsBoxIcon: { - color: "white" - }, - userStatsBox: { - flex: 1, - backgroundColor:'white', - flexDirection: "row" - }, - userBox: { - alignItems: "center", - justifyContent: "center", - width: "33%" - }, - userCurriculum: { - paddingTop: 5, - color: "red", - fontWeight: "bold", - fontSize: 15 - }, - userBioRow: { - flex: 1, - flexDirection: "row", - padding: 10 - }, - userBioText: {}, - userBioLogo: { - marginLeft: SCREEN_WIDTH * 0.05, - width: SCREEN_WIDTH * 0.15 - }, + margin: 10, - userTextSub: { - backgroundColor: "rgba(0,0,0,0.7)", - color: "white" - }, - userText: { - backgroundColor: "rgba(0,0,0,0.7)", - color: "white", - fontWeight: "bold", - fontSize: 20 - }, - homeHeader: { - flex: 1, + marginTop: 5, + width: "100%" + }, + userBoxText: { + color: "white", + fontWeight: "bold" + }, + userStatsBoxIcon: { + color: "white" + }, + userStatsBox: { + flex: 1, + backgroundColor: 'white', + flexDirection: "row" + }, + userBox: { + alignItems: "center", + justifyContent: "center", + width: "33%" + }, + userCurriculum: { + paddingTop: 5, + color: "red", + fontWeight: "bold", + fontSize: 15 + }, + userBioRow: { + flex: 1, + flexDirection: "row", + padding: 10 + }, + userBioText: {}, + userBioLogo: { + marginLeft: SCREEN_WIDTH * 0.05, + width: SCREEN_WIDTH * 0.15 + }, - height: SCREEN_HEIGHT * 0.3, - justifyContent: "center", - alignItems: "center" - }, - userImage: { - width: 110, - height: 110, - borderWidth: 1, - borderRadius: 5, - borderWidth: 2, - borderColor: "white" - }, - userBio: { - flex: 1, - padding: 10, - margin: 9, - backgroundColor: "white", - // height: SCREEN_HEIGHT*0.20, - color: "black", - borderRadius: 5 - }, - userStats: { - backgroundColor: "white", - height: SCREEN_HEIGHT * 0.2, - // padding: 10, - margin: 10, - borderRadius: 5, - marginTop: 10, - marginBottom: 0 - }, - userStatsTitle: { - margin:10, - color: "white", - fontSize: 17, - fontWeight: "bold", - padding: 1 - }, - userImageContainer: { - alignSelf: "center" + userTextSub: { + backgroundColor: "rgba(0,0,0,0.7)", + color: "white" + }, + userText: { + backgroundColor: "rgba(0,0,0,0.7)", + color: "white", + fontWeight: "bold", + fontSize: 20 + }, + homeHeader: { + flex: 1, - // transform: [{ rotate: '-15deg'}], - } + height: SCREEN_HEIGHT * 0.3, + justifyContent: "center", + alignItems: "center" + }, + userImage: { + width: 110, + height: 110, + borderWidth: 1, + borderRadius: 5, + borderWidth: 2, + borderColor: "white" + }, + userBio: { + flex: 1, + padding: 10, + margin: 9, + backgroundColor: "white", + // height: SCREEN_HEIGHT*0.20, + color: "black", + borderRadius: 5 + }, + userStats: { + backgroundColor: "white", + height: SCREEN_HEIGHT * 0.2, + // padding: 10, + margin: 10, + borderRadius: 5, + marginTop: 10, + marginBottom: 0 + }, + userStatsTitle: { + margin: 10, + color: "white", + fontSize: 17, + fontWeight: "bold", + padding: 1 + }, + userImageContainer: { + alignSelf: "center" + + // transform: [{ rotate: '-15deg'}], + } }); + function mapStateToProps(state, props) { - return { - token: state.apiReducer.token, - user: state.apiReducer.user, - logged: state.apiReducer.logged, - userDetails: state.apiReducer.userDetails, - onHold: state.apiReducer.onHold - }; + return { + token: state.apiReducer.token, + user: state.apiReducer.user, + logged: state.apiReducer.logged, + userDetails: state.apiReducer.userDetails, + onHold: state.apiReducer.onHold + }; } function mapDispatchToProps(dispatch) { - return bindActionCreators(Actions, dispatch); + return bindActionCreators(Actions, dispatch); } export default connect( - mapStateToProps, - mapDispatchToProps + mapStateToProps, + mapDispatchToProps )(Home); diff --git a/App/app/screens/rallyDetail.js b/App/app/screens/rallyDetail.js new file mode 100644 index 00000000..fc419129 --- /dev/null +++ b/App/app/screens/rallyDetail.js @@ -0,0 +1,46 @@ +import * as React from "react"; +import {View, StyleSheet, Dimensions, Text, Button, ScrollView} from "react-native"; +import {TabView, TabBar, SceneMap} from "react-native-tab-view"; + +import * as Actions from "../store/actions"; +import {connect} from "react-redux"; +import {bindActionCreators} from "redux"; + +export default class rallyDetail extends React.Component { + + + renderHeader = () => { + + }; + + + render() { + return ( + + + + ) + + + } +} + + +function mapStateToProps(state, props) { + + return { + + token: state.apiReducer.token, + user: state.apiReducer.user, + logged: state.apiReducer.logged, + events: state.apiReducer.events + + } +} + +function mapDispatchToProps(dispatch) { + + return bindActionCreators(Actions, dispatch); +} + +export default connect(mapStateToProps, mapDispatchToProps)(rallyDetail); \ No newline at end of file diff --git a/App/app/screens/rallyTascas.js b/App/app/screens/rallyTascas.js index 90f318d3..491811ab 100644 --- a/App/app/screens/rallyTascas.js +++ b/App/app/screens/rallyTascas.js @@ -34,7 +34,7 @@ function mapStateToProps(state, props) { token: state.apiReducer.token, user: state.apiReducer.user, logged: state.apiReducer.logged, - events: state.apiReducer.events + //rally: state.apiReducer.rally } }