This commit is contained in:
João Borges 2019-03-18 16:44:41 +00:00
parent c2b7539e2f
commit ce8d7ed01d
3 changed files with 446 additions and 385 deletions

View File

@ -1,4 +1,4 @@
import React, { Component } from "react";
import React, {Component} from "react";
import {
Button,
@ -15,24 +15,25 @@ import {
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";
@ -43,6 +44,7 @@ class Home extends Component {
// this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that");
};
_refresh() {
return new Promise(resolve => {
setTimeout(() => {
@ -50,21 +52,24 @@ class Home extends Component {
}, 2000);
});
}
_callApi() {
this.props.getUserInfo(this.props.token);
}
constructor(props) {
super(props);
this.state = {
token: { valid: false },
token: {valid: false},
logged: true,
onHold: true,
user: { Name: "" },
user: {Name: ""},
userDetails: {},
appState: AppState.currentState
};
}
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
};
@ -84,7 +89,9 @@ class Home extends Component {
//console.log(th2is.props)
}
componentWillUnmount() {}
componentWillUnmount() {
}
bClick() {
//this.props.logoutUser();
@ -96,25 +103,31 @@ class Home extends Component {
//var navigate = this.props.navigation.navigate
}
_update = () => {
this.props.getUserInfo(this.props.userDetails.token);
};
/*_removeMember = (membro.id) => {
};*/
render() {
const { navigate } = this.props.navigation;
const {navigate} = this.props.navigation;
if (this.props.onHold) {
return (
<View>
<Text>lollsss {this.props.onHold}</Text>
<ActivityIndicator size="large" color="#0000ff" />
<ActivityIndicator size="large" color="#0000ff"/>
</View>
);
}
if (this.props.logged) {
return (
<PTRView onRefresh={this._update}>
<ScrollView style={{ backgroundColor: "#eeeeee" }}>
<ScrollView style={{backgroundColor: "#eeeeee"}}>
<View>
<ImageBackground
opacity={0.9}
@ -130,7 +143,7 @@ class Home extends Component {
<View style={styles.userImageContainer}>
<Image
style={styles.userImage}
source={{ uri: "https://i.imgur.com/XXJ7LxV.jpg" }}
source={{uri: "https://i.imgur.com/XXJ7LxV.jpg"}}
/>
</View>
{this.props.user != undefined && (
@ -143,13 +156,13 @@ class Home extends Component {
</ImageBackground>
<View style={styles.userStats}>
<View style={{backgroundColor:'orange'}}>
<View style={{backgroundColor: 'orange'}}>
<Text style={styles.userStatsTitle}>Informações Importantes</Text>
</View>
<View style={styles.userStatsBox}>
<Text style={{margin:10}}>Grupo de ....</Text>
<Text style={{margin:10}}>Alojamento</Text>
<Text style={{margin: 10}}>Grupo de ....</Text>
<Text style={{margin: 10}}>Alojamento</Text>
</View>
</View>
@ -162,8 +175,8 @@ class Home extends Component {
borderRadius: 3
}}
>
<View style={{ backgroundColor: "#CC1A17" , flex:1, flexDirection:'row'}}>
<View style={{width:'79%'}}>
<View style={{backgroundColor: "#CC1A17", flex: 1, flexDirection: 'row'}}>
<View style={{width: '79%'}}>
<Text
style={{
fontSize: 25,
@ -185,32 +198,33 @@ class Home extends Component {
5/6 elementos
</Text>
</View>
<View style={{alignItems:'center', alignContent:'center',alignSelf:'center'}}>
<IconFA name="plus" color={'white'} size={30} />
<Text style={{color:'white'}}>Adicionar</Text>
<View
style={{alignItems: 'center', alignContent: 'center', alignSelf: 'center'}}>
<IconFA name="plus" color={'white'} size={30}/>
<Text style={{color: 'white'}}>Adicionar</Text>
</View>
</View>
<View>
<View style={{ flex: 1 }}>
<View style={{flex: 1}}>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
<IconFA name="user" size={40}/>
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<TouchableOpacity style={styles.userRemove} /*onPress={() => this._removeMember(membro.id)}*/>
<Text style={{fontWeight:'bold'}}>rm equipa</Text>
<Text style={{fontWeight: 'bold'}}>rm equipa</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<Divider style={{backgroundColor: "black"}}/>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
<IconFA name="user" size={40}/>
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
@ -218,14 +232,14 @@ class Home extends Component {
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<IconFA name="times" color={"#CC1A17"} size={30}/>
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<Divider style={{backgroundColor: "black"}}/>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
<IconFA name="user" size={40}/>
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
@ -233,14 +247,14 @@ class Home extends Component {
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<IconFA name="times" color={"#CC1A17"} size={30}/>
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<Divider style={{backgroundColor: "black"}}/>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
<IconFA name="user" size={40}/>
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
@ -248,14 +262,14 @@ class Home extends Component {
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<IconFA name="times" color={"#CC1A17"} size={30}/>
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<Divider style={{backgroundColor: "black"}}/>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
<IconFA name="user" size={40}/>
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
@ -263,7 +277,7 @@ class Home extends Component {
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<IconFA name="times" color={"#CC1A17"} size={30}/>
<Text>remover</Text>
</TouchableOpacity>
</View>
@ -288,15 +302,15 @@ class Home extends Component {
}
const styles = StyleSheet.create({
userName:{
fontSize:16,
fontWeight:'bold'
userName: {
fontSize: 16,
fontWeight: 'bold'
},
userRemove: {
alignContent: "center",
alignItems: "center",
alignSelf:'center'
alignSelf: 'center'
},
userT: {
margin: 10,
@ -328,7 +342,7 @@ const styles = StyleSheet.create({
},
userStatsBox: {
flex: 1,
backgroundColor:'white',
backgroundColor: 'white',
flexDirection: "row"
},
userBox: {
@ -397,7 +411,7 @@ const styles = StyleSheet.create({
marginBottom: 0
},
userStatsTitle: {
margin:10,
margin: 10,
color: "white",
fontSize: 17,
fontWeight: "bold",
@ -409,6 +423,7 @@ const styles = StyleSheet.create({
// transform: [{ rotate: '-15deg'}],
}
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,

View File

@ -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 (
<View>
</View>
)
}
}
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);

View File

@ -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
}
}