logos
This commit is contained in:
parent
20111b9caf
commit
5f80816f16
File diff suppressed because one or more lines are too long
|
@ -265,12 +265,14 @@ class Jogo extends React.Component {
|
|||
justifyContent: "space-around"
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontWeight: "bold" }}> { this.props.cromos.pontuacao}</Text>
|
||||
{this.props.cromos!= undefined &&
|
||||
<Text style={{ fontWeight: "bold" }}> { this.props.cromos.pontuacao}</Text>}
|
||||
{this.props.cromos!= undefined &&
|
||||
<ProgressBarAnimated
|
||||
width={barWidth * 0.7}
|
||||
value={this.props.cromos.pontuacao*100/256}
|
||||
backgroundColorOnComplete="#CC2A17"
|
||||
/>
|
||||
/>}
|
||||
<Text style={{ fontWeight: "bold" }}>256</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
|
|
@ -1,477 +1,476 @@
|
|||
import React, {Component} from 'react'
|
||||
import {Card, Divider,} from 'react-native-elements'
|
||||
import React, { Component } from "react";
|
||||
import { Card, Divider } from "react-native-elements";
|
||||
import {
|
||||
Image,
|
||||
ImageBackground,
|
||||
Linking,
|
||||
ListView,
|
||||
Platform,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
TouchableOpacity,
|
||||
Dimensions,
|
||||
TextInput,
|
||||
Button,
|
||||
ActivityIndicator
|
||||
} from 'react-native'
|
||||
import PropTypes from 'prop-types';
|
||||
Image,
|
||||
ImageBackground,
|
||||
Linking,
|
||||
ListView,
|
||||
Platform,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
TouchableOpacity,
|
||||
Dimensions,
|
||||
TextInput,
|
||||
Button,
|
||||
ActivityIndicator
|
||||
} from "react-native";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import {connect, Provider} from "react-redux";
|
||||
import {bindActionCreators} from "redux";
|
||||
import { connect, Provider } from "react-redux";
|
||||
import { bindActionCreators } from "redux";
|
||||
import * as Actions from "../store/actions";
|
||||
|
||||
import {Validate} from '../Helpers/Validation'
|
||||
import {RkTextInput} from 'react-native-ui-kitten';
|
||||
import { Validate } from "../Helpers/Validation";
|
||||
import { RkTextInput } from "react-native-ui-kitten";
|
||||
|
||||
import {createStore} from 'redux';
|
||||
import { createStore } from "redux";
|
||||
|
||||
import Email from "../components/Email";
|
||||
|
||||
import Email from '../components/Email';
|
||||
|
||||
import Separator from '../components/Separator';
|
||||
import Tel from '../components/Telephone';
|
||||
|
||||
import Separator from "../components/Separator";
|
||||
import Tel from "../components/Telephone";
|
||||
|
||||
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
||||
const SCREEN_WIDTH = Dimensions.get("window").width;
|
||||
import Icon from "react-native-vector-icons/Ionicons"
|
||||
import ImagePicker from 'react-native-image-picker';
|
||||
|
||||
import Icon from "react-native-vector-icons/Ionicons";
|
||||
import ImagePicker from "react-native-image-picker";
|
||||
|
||||
var options = {
|
||||
title: 'Selecionar foto de perfil',
|
||||
|
||||
storageOptions: {
|
||||
skipBackup: true,
|
||||
path: 'images'
|
||||
}
|
||||
title: "Selecionar foto de perfil",
|
||||
|
||||
storageOptions: {
|
||||
skipBackup: true,
|
||||
path: "images"
|
||||
}
|
||||
};
|
||||
|
||||
class Profile extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
name: this.props.user.Name,
|
||||
userDetails: {},
|
||||
token: false,
|
||||
tokenData: "",
|
||||
loggedIn: false,
|
||||
onHold: true,
|
||||
user: {},
|
||||
cenas: { Name: "as" },
|
||||
text: "",
|
||||
profileIcon: this.props.user.Avatar,
|
||||
|
||||
formValid: true,
|
||||
|
||||
jobs: this.props.user.Company,
|
||||
jobsError: false,
|
||||
jobsErrorMessage: "",
|
||||
|
||||
email: this.props.user.Email,
|
||||
emailError: false,
|
||||
emailErrorMessage: "",
|
||||
|
||||
phone: this.props.user.Mobile,
|
||||
phoneError: false,
|
||||
phoneErrorMessage: "",
|
||||
|
||||
address: this.props.user.Address,
|
||||
addressError: false,
|
||||
addressErrorMessage: "",
|
||||
|
||||
city: this.props.user.City,
|
||||
cityError: false,
|
||||
cityErrorMessage: "",
|
||||
|
||||
oldPass: "",
|
||||
new1: "",
|
||||
new2: "",
|
||||
|
||||
url: this.props.user.Url,
|
||||
curso: this.props.user.LastName
|
||||
};
|
||||
}
|
||||
|
||||
_press = () => {
|
||||
this.props.hold();
|
||||
this.props.changePassword(
|
||||
this.props.token,
|
||||
this.state.oldPass,
|
||||
this.state.new1,
|
||||
this.state.new2
|
||||
);
|
||||
};
|
||||
_logout = () => {
|
||||
this.props.logoutUser();
|
||||
};
|
||||
|
||||
_validateData = (name, jobs, email, phone, address, city) => {
|
||||
let valid = null;
|
||||
|
||||
|
||||
class Profile extends Component {
|
||||
v = Validate("name", name);
|
||||
|
||||
let v = Validate("email", email);
|
||||
this.setState({ emailError: v[0], emailErrorMessage: v[1] });
|
||||
|
||||
constructor(props) {
|
||||
v = Validate("jobs", jobs);
|
||||
|
||||
super(props);
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({ jobsError: v[0], jobsErrorMessage: v[1] }, () => {
|
||||
console.log(
|
||||
"email error: " +
|
||||
this.state.emailError +
|
||||
" job Error: " +
|
||||
this.state.jobsError
|
||||
);
|
||||
});
|
||||
|
||||
this.state = {
|
||||
name: this.props.user.Name,
|
||||
userDetails: {},
|
||||
token: false,
|
||||
tokenData: '',
|
||||
loggedIn: false,
|
||||
onHold: true,
|
||||
user: {},
|
||||
cenas: {Name: 'as'},
|
||||
text: '',
|
||||
v = Validate("city", city);
|
||||
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({ cityError: v[0], cityErrorMessage: v[1] });
|
||||
|
||||
formValid: true,
|
||||
v = Validate("address", address);
|
||||
|
||||
jobs: this.props.user.Company,
|
||||
jobsError: false,
|
||||
jobsErrorMessage: '',
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({ addressError: v[0], addressErrorMessage: v[1] });
|
||||
|
||||
email: this.props.user.Email,
|
||||
emailError: false,
|
||||
emailErrorMessage: '',
|
||||
v = Validate("city", city);
|
||||
|
||||
phone: this.props.user.Mobile,
|
||||
phoneError: false,
|
||||
phoneErrorMessage: '',
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({ cityError: v[0], cityErrorMessage: v[1] }, () => {
|
||||
console.log(this.state.cityError + " Error: " + this.state.addressError);
|
||||
|
||||
address: this.props.user.Address,
|
||||
addressError: false,
|
||||
addressErrorMessage: '',
|
||||
if (
|
||||
this.state.emailError ||
|
||||
this.state.jobsError ||
|
||||
this.state.phoneError ||
|
||||
this.state.addressError ||
|
||||
this.state.cityError
|
||||
)
|
||||
this.setState({ formValid: false });
|
||||
});
|
||||
};
|
||||
|
||||
city: this.props.user.City,
|
||||
cityError: false,
|
||||
cityErrorMessage: '',
|
||||
saveData() {
|
||||
const {
|
||||
name,
|
||||
jobs,
|
||||
email,
|
||||
phone,
|
||||
address,
|
||||
city,
|
||||
formValid,
|
||||
url,
|
||||
curso,
|
||||
profileIcon
|
||||
} = this.state;
|
||||
|
||||
oldPass:'',
|
||||
new1:'',
|
||||
new2:'',
|
||||
// this._validateData(name, jobs, email, phone, address, city,curso);
|
||||
|
||||
url:this.props.user.Url,
|
||||
curso:this.props.user.LastName,
|
||||
|
||||
console.log(formValid);
|
||||
|
||||
};
|
||||
}
|
||||
this.props.hold();
|
||||
if (formValid) {
|
||||
console.log("data valid");
|
||||
|
||||
_press=()=>{
|
||||
this.props.hold()
|
||||
this.props.changePassword(
|
||||
this.props.token,
|
||||
this.state.oldPass,
|
||||
this.state.new1,
|
||||
this.state.new2
|
||||
)
|
||||
}
|
||||
_logout = () => {
|
||||
this.props.updateUser(this.props.token, {
|
||||
Name: this.state.name,
|
||||
Company: jobs,
|
||||
LastName: curso,
|
||||
Address: address,
|
||||
City: city,
|
||||
Mobile: phone,
|
||||
//Avatar: "aaa",
|
||||
Url: url
|
||||
});
|
||||
} else console.log("data not valid");
|
||||
}
|
||||
_open = () => {
|
||||
ImagePicker.showImagePicker(options, response => {
|
||||
console.log("Response = ", response);
|
||||
|
||||
this.props.logoutUser();
|
||||
};
|
||||
if (response.didCancel) {
|
||||
console.log("User cancelled image picker");
|
||||
} else if (response.error) {
|
||||
console.log("ImagePicker Error: ", response.error);
|
||||
} else if (response.customButton) {
|
||||
console.log("User tapped custom button: ", response.customButton);
|
||||
} else {
|
||||
const source = { uri: response.uri };
|
||||
|
||||
// You can also display the image using data:
|
||||
// const source = { uri: 'data:image/jpeg;base64,' + response.data };
|
||||
|
||||
_validateData = (name, jobs, email, phone, address, city) => {
|
||||
let valid = null;
|
||||
|
||||
v = Validate('name', name);
|
||||
|
||||
|
||||
let v = Validate('email', email);
|
||||
this.setState({emailError: v[0], emailErrorMessage: v[1]});
|
||||
|
||||
v = Validate('jobs', jobs);
|
||||
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({jobsError: v[0], jobsErrorMessage: v[1]}, () => {
|
||||
|
||||
console.log('email error: ' + this.state.emailError + ' job Error: ' + this.state.jobsError);
|
||||
this.setState({
|
||||
avatarSource: source
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
v = Validate('city', city);
|
||||
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({cityError: v[0], cityErrorMessage: v[1]})
|
||||
|
||||
|
||||
v = Validate('address', address);
|
||||
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({addressError: v[0], addressErrorMessage: v[1]});
|
||||
|
||||
|
||||
v = Validate('city', city);
|
||||
|
||||
// setState is asynchronous and so trying to work with state directly after a setState
|
||||
// call won't work as the update won't necessarily have run. Instead you can use the second argument to setState which is a callback
|
||||
this.setState({cityError: v[0], cityErrorMessage: v[1]}, () => {
|
||||
console.log(this.state.cityError + ' Error: ' + this.state.addressError);
|
||||
|
||||
if (this.state.emailError || this.state.jobsError || this.state.phoneError || this.state.addressError || this.state.cityError)
|
||||
this.setState({formValid: false});
|
||||
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
saveData() {
|
||||
|
||||
const {name, jobs, email, phone, address, city, formValid, url,curso} = this.state;
|
||||
|
||||
// this._validateData(name, jobs, email, phone, address, city,curso);
|
||||
|
||||
console.log(formValid);
|
||||
|
||||
this.props.hold();
|
||||
if (formValid) {
|
||||
console.log("data valid");
|
||||
|
||||
this.props.updateUser(this.props.token, {
|
||||
Name: this.state.name,
|
||||
Company: jobs,
|
||||
LastName: curso,
|
||||
Address: address,
|
||||
City: city,
|
||||
Mobile: phone,
|
||||
Avatar: "base64",
|
||||
Url:url,
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
console.log("data not valid");
|
||||
|
||||
render() {
|
||||
if (this.props.onHold) {
|
||||
return (
|
||||
<View style={{ marginTop: SCREEN_HEIGHT * 0.4 }}>
|
||||
<ActivityIndicator size="large" color="#CC1A17" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
_open=()=>{
|
||||
ImagePicker.showImagePicker(options, (response) => {
|
||||
console.log('Response = ', response);
|
||||
|
||||
if (response.didCancel) {
|
||||
console.log('User cancelled image picker');
|
||||
} else if (response.error) {
|
||||
console.log('ImagePicker Error: ', response.error);
|
||||
} else if (response.customButton) {
|
||||
console.log('User tapped custom button: ', response.customButton);
|
||||
} else {
|
||||
const source = { uri: response.uri };
|
||||
|
||||
// You can also display the image using data:
|
||||
// const source = { uri: 'data:image/jpeg;base64,' + response.data };
|
||||
|
||||
this.setState({
|
||||
avatarSource: source,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.onHold) {
|
||||
return (
|
||||
<View style={{marginTop:SCREEN_HEIGHT*0.40}}>
|
||||
|
||||
<ActivityIndicator size="large" color="#CC1A17" />
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<ScrollView style={{ backgroundColor: "#eee" }}>
|
||||
<View style={styles.container}>
|
||||
<View style={styles.userBioRowHeader}>
|
||||
<View style={styles.userBioRowTitle}>
|
||||
<Text
|
||||
style={{ color: "#CC1A17", fontWeight: "bold", fontSize: 20 }}
|
||||
>
|
||||
Informações Pessoais
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<View style={{flex: 1}}>
|
||||
<ScrollView style={{backgroundColor: '#eee'}}>
|
||||
<View style={styles.container}>
|
||||
<View style={styles.userBioRowHeader}>
|
||||
<View style={styles.userBioRowTitle}>
|
||||
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Informações Pessoais</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
<Image source={this.state.avatarSource} />
|
||||
<Button onPress={ this._open} title="Editar foto de perfil" color="#CC1A17"
|
||||
/>
|
||||
<View style={styles.userBio}>
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo} >Nome</Text>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
onChangeText={(n) => {
|
||||
this.setState({name: n})
|
||||
}}
|
||||
value={this.state.name}/>
|
||||
</View>
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo} >Curso</Text>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
onChangeText={(cu) => {
|
||||
this.setState({curso: cu})
|
||||
}}
|
||||
value={this.state.curso}/>
|
||||
</View>
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo} >Faculdade</Text>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
onChangeText={(job) => {
|
||||
this.setState({jobs: job})
|
||||
}}
|
||||
value={this.state.jobs}/>
|
||||
</View>
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo} >Telemóvel</Text>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
onChangeText={(phone) => {
|
||||
this.setState({phone: phone})
|
||||
}}
|
||||
value={this.state.phone}/>
|
||||
</View>
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo} >Morada</Text>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
onChangeText={(add) => {
|
||||
this.setState({address: add})
|
||||
}}
|
||||
value={this.state.address}/>
|
||||
</View>
|
||||
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo} >LinkedIn</Text>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
onChangeText={(u) => {
|
||||
this.setState({url: u})
|
||||
}}
|
||||
value={this.state.url}/>
|
||||
</View>
|
||||
|
||||
|
||||
<Button onPress={() => this.saveData() } title="Guardar Alterações" color="#CC1A17"
|
||||
/>
|
||||
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/*PassWord Edit*/}
|
||||
<View style={styles.container}>
|
||||
<View style={styles.userBioRowHeader}>
|
||||
<View style={styles.userBioRowTitle}>
|
||||
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Alterar Password</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.userBio}>
|
||||
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
placeholder='Antiga Password'
|
||||
onChangeText={(old => {
|
||||
this.setState({oldPass: old})
|
||||
})}
|
||||
value={this.state.oldPass}
|
||||
maxLength = {20}
|
||||
|
||||
secureTextEntry={true}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
placeholder='Nova Password'
|
||||
secureTextEntry={true}
|
||||
onChangeText={(newz => {
|
||||
this.setState({new1: newz})
|
||||
})}
|
||||
value={this.state.new1}
|
||||
maxLength = {20}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{backgroundColor: 'black'}}/>
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
|
||||
|
||||
<TextInput style={styles.userBioText}
|
||||
placeholder='Repetir Password'
|
||||
secureTextEntry={true}
|
||||
onChangeText={(newzz => {
|
||||
this.setState({new2: newzz})
|
||||
})}
|
||||
value={this.state.new2}
|
||||
maxLength = {20}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<Button onPress={this._press} title="Alterar Password" color="#CC1A17"
|
||||
/>
|
||||
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<TouchableOpacity onPress={this._logout} style={{
|
||||
height: 50,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: 'black',
|
||||
marginTop:30
|
||||
}}>
|
||||
<Text style={{color: "#fff", fontWeight: 'bold'}}>Logout</Text>
|
||||
|
||||
</TouchableOpacity>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
|
||||
|
||||
</View>
|
||||
<Image source={this.state.avatarSource} />
|
||||
|
||||
)
|
||||
}
|
||||
<View style={styles.userBio}>
|
||||
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo}>Nome</Text>
|
||||
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
onChangeText={n => {
|
||||
this.setState({ name: n });
|
||||
}}
|
||||
value={this.state.name}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo}>Curso</Text>
|
||||
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
onChangeText={cu => {
|
||||
this.setState({ curso: cu });
|
||||
}}
|
||||
value={this.state.curso}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo}>Faculdade</Text>
|
||||
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
onChangeText={job => {
|
||||
this.setState({ jobs: job });
|
||||
}}
|
||||
value={this.state.jobs}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo}>Telemóvel</Text>
|
||||
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
onChangeText={phone => {
|
||||
this.setState({ phone: phone });
|
||||
}}
|
||||
value={this.state.phone}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo}>Morada</Text>
|
||||
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
onChangeText={add => {
|
||||
this.setState({ address: add });
|
||||
}}
|
||||
value={this.state.address}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<Text style={styles.userBioLogo}>LinkedIn</Text>
|
||||
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
onChangeText={u => {
|
||||
this.setState({ url: u });
|
||||
}}
|
||||
value={this.state.url}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<Button
|
||||
onPress={() => this.saveData()}
|
||||
title="Guardar Alterações"
|
||||
color="#CC1A17"
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/*PassWord Edit*/}
|
||||
<View style={styles.container}>
|
||||
<View style={styles.userBioRowHeader}>
|
||||
<View style={styles.userBioRowTitle}>
|
||||
<Text
|
||||
style={{ color: "#CC1A17", fontWeight: "bold", fontSize: 20 }}
|
||||
>
|
||||
Alterar Password
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.userBio}>
|
||||
<View style={styles.userBioRow}>
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
placeholder="Antiga Password"
|
||||
onChangeText={old => {
|
||||
this.setState({ oldPass: old });
|
||||
}}
|
||||
value={this.state.oldPass}
|
||||
maxLength={20}
|
||||
secureTextEntry={true}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
placeholder="Nova Password"
|
||||
secureTextEntry={true}
|
||||
onChangeText={newz => {
|
||||
this.setState({ new1: newz });
|
||||
}}
|
||||
value={this.state.new1}
|
||||
maxLength={20}
|
||||
/>
|
||||
</View>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
|
||||
<View style={styles.userBioRow}>
|
||||
<TextInput
|
||||
style={styles.userBioText}
|
||||
placeholder="Repetir Password"
|
||||
secureTextEntry={true}
|
||||
onChangeText={newzz => {
|
||||
this.setState({ new2: newzz });
|
||||
}}
|
||||
value={this.state.new2}
|
||||
maxLength={20}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<Button
|
||||
onPress={this._press}
|
||||
title="Alterar Password"
|
||||
color="#CC1A17"
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<TouchableOpacity
|
||||
onPress={this._logout}
|
||||
style={{
|
||||
height: 50,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "black",
|
||||
marginTop: 30
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: "#fff", fontWeight: "bold" }}>Logout</Text>
|
||||
</TouchableOpacity>
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 10,
|
||||
margin: 10,
|
||||
backgroundColor: "white",
|
||||
borderRadius: 5
|
||||
},
|
||||
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 10,
|
||||
margin: 10,
|
||||
backgroundColor: 'white',
|
||||
borderRadius: 5,
|
||||
},
|
||||
userBioRowHeader: {
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
alignItems: "center"
|
||||
},
|
||||
|
||||
userBioRowHeader: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
},
|
||||
userBioRowTitle: {
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
justifyContent: "flex-start",
|
||||
padding: 10
|
||||
},
|
||||
|
||||
userBioRowTitle: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-start',
|
||||
padding: 10,
|
||||
},
|
||||
userBioRow: {
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
justifyContent: "flex-start",
|
||||
padding: 10,
|
||||
// borderWidth: 2,
|
||||
alignItems: "center"
|
||||
},
|
||||
userBioText: {
|
||||
width: SCREEN_WIDTH * 0.4,
|
||||
flex: 2
|
||||
// borderWidth: 2,
|
||||
},
|
||||
|
||||
userBioRow: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-start',
|
||||
padding: 10,
|
||||
// borderWidth: 2,
|
||||
alignItems: 'center',
|
||||
|
||||
},
|
||||
userBioText: {
|
||||
width: SCREEN_WIDTH * 0.40,
|
||||
flex: 2,
|
||||
// borderWidth: 2,
|
||||
},
|
||||
|
||||
userPassText: {
|
||||
flex: 1,
|
||||
//alignSelf: 'flex-start',
|
||||
justifyContent: 'flex-end',
|
||||
borderWidth: 2,
|
||||
},
|
||||
|
||||
userBioLogo: {
|
||||
marginLeft: 10,
|
||||
width:80,
|
||||
},
|
||||
|
||||
bottomLogOut: {
|
||||
height: 20,
|
||||
},
|
||||
userPassText: {
|
||||
flex: 1,
|
||||
//alignSelf: 'flex-start',
|
||||
justifyContent: "flex-end",
|
||||
borderWidth: 2
|
||||
},
|
||||
|
||||
userBioLogo: {
|
||||
marginLeft: 10,
|
||||
width: 80
|
||||
},
|
||||
|
||||
bottomLogOut: {
|
||||
height: 20
|
||||
}
|
||||
});
|
||||
|
||||
mapStateToProps = (state, props) => {
|
||||
|
||||
return {
|
||||
|
||||
token: state.apiReducer.token,
|
||||
user: state.apiReducer.user,
|
||||
userDetails: state.apiReducer.userDetails,
|
||||
onHold:state.apiReducer.onHold
|
||||
}
|
||||
return {
|
||||
token: state.apiReducer.token,
|
||||
user: state.apiReducer.user,
|
||||
userDetails: state.apiReducer.userDetails,
|
||||
onHold: state.apiReducer.onHold
|
||||
};
|
||||
};
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Profile);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(Profile);
|
||||
|
|
|
@ -32,9 +32,11 @@ import {RkButton,
|
|||
|
||||
onSuccess = (e) => {
|
||||
|
||||
this.setState({ isModalVisible: !this.state.isModalVisible ,isActive:false});
|
||||
|
||||
this.setState({code:e.data});
|
||||
this.props.scanQrCode({UserQR:this.props.user.Code, ScanQR: e.data},this.props.internalToken);
|
||||
|
||||
|
||||
};
|
||||
|
||||
state = {
|
||||
|
@ -63,17 +65,8 @@ import {RkButton,
|
|||
<View style={{flex: 1}}>
|
||||
|
||||
|
||||
<Modal
|
||||
onBackdropPress={this._activate}
|
||||
isVisible={this.state.isModalVisible} style={{backgroundColor:'#E8E8E8', borderRadius:3, marginTop: SCREEN_HEIGHT*0.2, marginBottom: SCREEN_HEIGHT*0.2}}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text></Text>
|
||||
<Text> Qr code data: {this.state.code}</Text>
|
||||
<Button onPress={this._activate} title="Close" color="#841584" accessibilityLabel="Learn more about this purple button"/>
|
||||
|
||||
</View>
|
||||
</Modal>
|
||||
|
||||
|
||||
|
||||
{ this.state.isRender &&
|
||||
|
||||
<QRCodeScanner
|
||||
|
|
|
@ -59,7 +59,7 @@ class calendarDetail extends React.Component {
|
|||
state = {};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.getEvents(this.props.user);
|
||||
this.props.getEvents(this.props.user, this.props.careerPath);
|
||||
|
||||
const { navigation } = this.props;
|
||||
const info = navigation.getParam("info", "error");
|
||||
|
|
|
@ -330,7 +330,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"https://upload.wikimedia.org/wikipedia/commons/8/8a/CSW_Gradiente_rgb.png"
|
||||
"https://enei.pt/logos/critical-sponsor.png"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
@ -360,7 +360,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"http://apdsi.pt/wp-content/uploads/2018/09/accenture-logo.jpg"
|
||||
"https://enei.pt/logos/accenture-logo.jpg"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
@ -389,7 +389,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"https://res.cloudinary.com/hrscywv4p/image/upload/c_limit,fl_lossy,h_960,w_480,f_auto,q_auto/v1/9310/blip_powering_logo_ygabw1.png"
|
||||
"https://enei.pt/logos/blip.png"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
@ -422,7 +422,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"http://www.ambienteonline.pt/contents/mlist/12fnr_ubiwhere_web.png"
|
||||
"https://enei.pt/logos/ubiwhere.png"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
@ -455,7 +455,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"http://www.empregoestagios.com/wp-content/uploads/2015/07/feedzai-660x330.jpg"
|
||||
"https://enei.pt/logos/feedzai.jpg"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
@ -464,7 +464,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"https://www.idcdx.pt/diretorio/wp-content/uploads/2018/08/versao_principal_sem_assinatura.png"
|
||||
"https://enei.pt/logos/nova.png"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
@ -497,7 +497,7 @@ class choosePath extends React.Component {
|
|||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"https://upload.wikimedia.org/wikipedia/commons/thumb/7/72/DeloitteNewLogo.jpg/1200px-DeloitteNewLogo.jpg"
|
||||
"https://enei.pt/logos/delloite.jpg"
|
||||
}}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
|
|
|
@ -36,7 +36,7 @@ class teamDetail extends React.Component {
|
|||
this.props.internalToken
|
||||
);*/
|
||||
|
||||
console.log(this.props.locais); ne
|
||||
console.log(this.props.locais);
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
|
@ -161,26 +161,6 @@ class teamDetail extends React.Component {
|
|||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
alignContent: "center",
|
||||
alignSelf:'center'
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
style={{ textAlign: "right", fontSize: 12, paddingTop: 5 , marginRight:5}}
|
||||
>
|
||||
Arrasta o ecrã para atualizar
|
||||
</Text>
|
||||
<IconFA
|
||||
name="chevron-circle-down"
|
||||
size={13}
|
||||
color={"#CC1A17"}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.container}>
|
||||
<View style={{ flex: 1, width: "100%" }}>
|
||||
{this.props.locais && (
|
||||
|
@ -383,4 +363,4 @@ function mapDispatchToProps(dispatch) {
|
|||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(teamDetail);
|
||||
)(teamDetail);
|
|
@ -59,8 +59,8 @@ export function scanQrCode(data, tokenInternal) {
|
|||
axios
|
||||
.post("/api/Scan", data)
|
||||
.then(a => {
|
||||
console.log(a.data);
|
||||
Alert.alert("SUCESSO!", a.data);
|
||||
|
||||
Alert.alert("SUCESSO!", "Cromo adicionado com sucesso!");
|
||||
dispatch({
|
||||
type: SCAN_QR
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@ let apiState = {
|
|||
sessions: {},
|
||||
Blocks: {},
|
||||
onHoldBlocks: true,
|
||||
careerPath: { name: "Sem Career Path", color: "#eeeeee" },
|
||||
careerPath: { name: "Sem Career Path", color: "#eeeeee" , code:''},
|
||||
a: {},
|
||||
b: {},
|
||||
c: {},
|
||||
|
|
Loading…
Reference in New Issue