This commit is contained in:
henrydays 2019-03-23 19:03:56 +00:00
parent 40a2b1199d
commit b156bb6518
9 changed files with 824 additions and 157 deletions

View File

@ -43,12 +43,15 @@ import eventDetail from './screens/eventDetail';
import teamDetail from './screens/teamDetail';
import event from './screens/event';
const navigationOptions = ({navigation}) => ({
headerLeft: <HeaderBackButton onPress={() => 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({
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('Profile')}>
<Text>Editar dados</Text>
<Text style={{marginRight:5}}>Editar dados</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity>
)
}
}
if (navigation.state.routes[index].routeName == 'Jogo do...') {
if (navigation.state.routes[index].routeName == 'Jogo') {
return {
header: (<View style={{backgroundColor:'#CC1A17', padding:15}}>
<Text style={{textAlign:'center', alignSelf:'center', color:'white', fontSize:20, fontWeight:'bold'}}>Jogo do ENEI'19</Text>
@ -164,8 +167,8 @@ const Stack = createStackNavigator({
<TouchableOpacity style={{marginRight: 20, flex: 1, flexDirection: 'row'}}
onPress={() => navigation.navigate('choosePath')}>
<Text>Inscrições</Text>
<IconFA name="user-edit" size={22}/>
<Text style={{color:'#CC1A17', marginRight:5}}>Inscrições</Text>
<IconFA name="user-edit" size={22} color={'#CC1A17'}/>
</TouchableOpacity></View>
)
@ -225,6 +228,9 @@ const Stack = createStackNavigator({
resetPassword:{
screen:resetPassword
},
event:{
screen: event
}
});

View File

@ -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 (
<PTRView onRefresh={this._update}>
<View style={styles.container}>
{this.props.eventsInternal == undefined && (
<View
style={{
height: SCREEN_HEIGHT,
marginTop: SCREEN_HEIGHT * 0.27,
backgroundColor: "white"
}}
>
<Text style={{ fontSize: 12, margin: 15, textAlign: "center" }}>
Se estiver a demorar muito, arrasta para atualizar
</Text>
render() {
const {navigate} = this.props.navigation;
return (
<PTRView onRefresh={this._update}>
<View style={styles.container}>
<ScrollView styles={styles.scroll}>
{
this.props.eventsInternal==undefined &&
<View style={{height:SCREEN_HEIGHT, marginTop:SCREEN_HEIGHT*0.27, backgroundColor:'white'}}>
<Text style={{fontSize:12, margin:15, textAlign:'center'}}>Se estiver a demorar muito, arrasta para atualizar</Text>
<View style={{width:80, alignContent:'center', alignItems:'center'}}><Button onPress={this._update} title="Refresh" color="#CC1A17"
/></View>
<ActivityIndicator size="large" color="#CC1A17" /></View>
}
<FlatList
data={this.props.eventsInternal}
renderItem={({item}) =>
<View>
<TouchableOpacity onPress={() => navigate('eventDetail', {info: item})}>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={{uri: item.imagem}}
>
</Image>
<View style={styles.cardDesc}>
<Text style={styles.cardDescText}>{item.nome}</Text>
<Text style={styles.cardHours}>{item.horas}</Text>
</View>
</View>
</TouchableOpacity>
</View>}
/>
</ScrollView>
<ActivityIndicator size="large" color="#CC1A17" />
</View>
)}
<ScrollView styles={styles.scroll}>
<FlatList
data={this.props.eventsInternal}
renderItem={({ item }) => (
<View>
<TouchableOpacity
onPress={() => navigate("event", { info: item })}
>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={{ uri: item.imagem }}
/>
<View style={styles.cardDesc}>
<Text style={styles.cardDescText}>{item.nome}</Text>
<Text style={styles.cardHours}>{item.horas}</Text>
</View>
</View>
</TouchableOpacity>
</View>
</PTRView>
);
}
)}
/>
</ScrollView>
</View>
</PTRView>
);
}
}
const styles = StyleSheet.create({
cardHours: {
textAlign: 'center',
color: 'white',
margin: 10,
cardHours: {
textAlign: "center",
color: "white",
margin: 10
// width:'20%'
},
// width:'20%'
},
cardDesc: {
//alignSelf:'center',
backgroundColor: '#CC1A17',
// flex:1,
flexDirection: 'row',
cardDesc: {
//alignSelf:'center',
backgroundColor: "#CC1A17",
// flex:1,
flexDirection: "row"
},
cardDescText: {
fontWeight: "bold",
color: "white",
fontSize: 18,
width: "45%",
margin: 10
},
container: {
backgroundColor: "white",
flex: 1,
flexGrow: 1,
flexDirection: "column",
paddingBottom: 20
},
},
cardDescText: {
fontWeight: 'bold',
color: 'white',
fontSize: 18,
scroll: {
flex: 1
},
width: '45%',
margin: 10
cardContainer: {
flex: 1,
//flexDirection: 'row',
//padding: 10,
margin: 20,
marginBottom: 0,
backgroundColor: "#fff",
height: SCREEN_WIDTH * 0.62,
borderRadius: 5
//borderWidth: 2,
},
},
container: {
backgroundColor: 'white',
flex: 1,
flexGrow: 1,
flexDirection: 'column',
paddingBottom: 20
},
scroll: {
flex: 1,
},
cardContainer: {
flex: 1,
//flexDirection: 'row',
//padding: 10,
margin: 20,
marginBottom: 0,
backgroundColor: '#fff',
height: SCREEN_WIDTH * 0.62,
borderRadius: 5,
//borderWidth: 2,
},
scene: {
flex: 1
}
scene: {
flex: 1
}
});
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,
bilhete: state.apiReducer.bilhete,
alimentacao: state.apiReducer.alimentacao,
alojamento: state.apiReducer.alojamento,
acesso: state.apiReducer.acesso,
team: state.apiReducer.team,
internalToken: state.apiReducer.internalToken,
eventsInternal: state.apiReducer.eventsInternal
};
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
userDetails: state.apiReducer.userDetails,
onHold: state.apiReducer.onHold,
bilhete: state.apiReducer.bilhete,
alimentacao: state.apiReducer.alimentacao,
alojamento: state.apiReducer.alojamento,
acesso: state.apiReducer.acesso,
team: state.apiReducer.team,
internalToken: state.apiReducer.internalToken,
eventsInternal: state.apiReducer.eventsInternal
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
return bindActionCreators(Actions, dispatch);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(Eventos);
mapStateToProps,
mapDispatchToProps
)(Eventos);

View File

@ -106,6 +106,7 @@ class Profile extends Component {
}
_press=()=>{
this.props.hold()
this.props.changePassword(
this.props.token,
this.state.oldPass,

View File

@ -196,7 +196,187 @@ class choosePath extends React.Component {
)}
{this._findPath("NET") && (
<LinearGradient
colors={["#5887FF", "#715AFF"]}
colors={["#67C43D", "#46B712"]}
style={styles.linearGradient}
>
<Text
style={{
margin: 15,
marginBottom: 0,
fontWeight: "bold",
color: "white"
}}
>
{" "}
Empresa responsável:{" "}
</Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
<Text
style={{
fontSize: 16,
fontWeight: "bold",
margin: 6,
color: "white"
}}
>
Altice
</Text>
<Text style={{ margin: 6, marginTop: 0, color: "white" }}>
Altice é uma multinacional neerlandesa de telecomunicações,
conteúdos, media, entretenimento e publicidade.
</Text>
</View>
<View style={styles.companyLogo}>
<FitImage
source={{
uri:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuIfl0Km4mTbCGdJSr4bWn_ApFHnOrjYsmJ4VlBL1OkaIlb93t"
}}
style={styles.fitImage}
/>
</View>
</View>
</LinearGradient>
)}
{this._findPath("WEB") && (
<LinearGradient
colors={["blue", "blue"]}
style={styles.linearGradient}
>
<Text
style={{
margin: 15,
marginBottom: 0,
fontWeight: "bold",
color: "white"
}}
>
{" "}
Empresa responsável:{" "}
</Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
<Text
style={{
fontSize: 16,
fontWeight: "bold",
margin: 6,
color: "white"
}}
>
Blip
</Text>
<Text style={{ margin: 6, marginTop: 0, color: "white" }}>
Altice é uma multinacional neerlandesa de telecomunicações,
conteúdos, media, entretenimento e publicidade.
</Text>
</View>
<View style={styles.companyLogo}>
<FitImage
source={{
uri:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuIfl0Km4mTbCGdJSr4bWn_ApFHnOrjYsmJ4VlBL1OkaIlb93t"
}}
style={styles.fitImage}
/>
</View>
</View>
</LinearGradient>
)}
{this._findPath("IOT") && (
<LinearGradient
colors={["#67C43D", "#46B712"]}
style={styles.linearGradient}
>
<Text
style={{
margin: 15,
marginBottom: 0,
fontWeight: "bold",
color: "white"
}}
>
{" "}
Empresa responsável:{" "}
</Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
<Text
style={{
fontSize: 16,
fontWeight: "bold",
margin: 6,
color: "white"
}}
>
ubiwhere
</Text>
<Text style={{ margin: 6, marginTop: 0, color: "white" }}>
Altice é uma multinacional neerlandesa de telecomunicações,
conteúdos, media, entretenimento e publicidade.
</Text>
</View>
<View style={styles.companyLogo}>
<FitImage
source={{
uri:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuIfl0Km4mTbCGdJSr4bWn_ApFHnOrjYsmJ4VlBL1OkaIlb93t"
}}
style={styles.fitImage}
/>
</View>
</View>
</LinearGradient>
)}
{this._findPath("DS") && (
<LinearGradient
colors={["#FF8A38", "#FD6A02"]}
style={styles.linearGradient}
>
<Text
style={{
margin: 15,
marginBottom: 0,
fontWeight: "bold",
color: "white"
}}
>
{" "}
Empresa responsável:{" "}
</Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
<Text
style={{
fontSize: 16,
fontWeight: "bold",
margin: 6,
color: "white"
}}
>
novabase e feedzai
</Text>
<Text style={{ margin: 6, marginTop: 0, color: "white" }}>
Altice é uma multinacional neerlandesa de telecomunicações,
conteúdos, media, entretenimento e publicidade.
</Text>
</View>
<View style={styles.companyLogo}>
<FitImage
source={{
uri:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuIfl0Km4mTbCGdJSr4bWn_ApFHnOrjYsmJ4VlBL1OkaIlb93t"
}}
style={styles.fitImage}
/>
</View>
</View>
</LinearGradient>
)}
{this._findPath("MOB") && (
<LinearGradient
colors={["orange", "#46B712"]}
style={styles.linearGradient}
>
<Text
@ -239,7 +419,6 @@ class choosePath extends React.Component {
</View>
</LinearGradient>
)}
<View
style={{
flex: 1,

460
App/app/screens/event.js Normal file
View File

@ -0,0 +1,460 @@
import * as React from "react";
import {
View,
StyleSheet,
Dimensions,
Image,
ScrollView,
Text,
Button,
TouchableOpacity,
ImageBackground,
ListView,
FlatList,
ActivityIndicator
} from "react-native";
import moment from "moment";
import {Divider, Icon, Avatar} from "react-native-elements";
import {TabView, TabBar, SceneMap} from "react-native-tab-view";
import {RkButton, RkCard, RkText, RkTheme} from "react-native-ui-kitten";
import Timeline from "react-native-timeline-feed";
import * as Progress from "react-native-progress";
import NavAbsolute from "../components/Nav";
import {connect} from "react-redux";
import {bindActionCreators} from "redux";
import * as Actions from "../store/actions"; //Import your actionss
import Swiper from "react-native-swiper";
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import FitImage from "react-native-fit-image";
import MapView, {PROVIDER_GOOGLE} from "react-native-maps";
const formatObj = obj => {
let a = {};
a.push({});
return a;
};
class event extends React.Component {
static navigationOptions = ({navigation}) => ({
header: (
<NavAbsolute
navigation={navigation}
// title={navigation.state.params.info.name}
/>
)
});
state = {};
componentDidMount() {
const {navigation} = this.props;
const info = navigation.getParam("info", "error");
}
_update = () => {
this.setState({user: this.props.user});
};
_renderRally = (info) => {
console.log(info)
return (
<View>
<View style={styles.header}>
<View
style={{
flexDirection: "row",
alignItems: "center",
alignSelf: "center"
}}
>
<View style={styles.leftRow}>
<Text style={{
margin: 10,
marginTop: 0,
marginBottom: 10,
fontSize: 20,
color: "#CC1A17" }}>
{info.location.nome}
</Text>
</View>
<View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
{info.hora}
</Text>
<Text>{info.horas}</Text>
</View>
</View>
<View>
<View style={{margin: 10}}>
<Text
style={{fontSize: 15, color: "#CC1A17", fontWeight: "bold"}}
>
Descrição:
</Text>
<Divider style={{backgroundColor: "#000"}}/>
<View style={{marginTop: 10}}>
<Text>{info.location.desc}</Text>
</View>
</View>
</View>
</View>
</View>
);
};
_renderEventDetail = (info) => {
return (
<View>
<View style={styles.header}>
<View
style={{
flexDirection: "row",
alignItems: "center",
alignSelf: "center"
}}
>
<View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
{info.hora}
</Text>
<Text>{info.horas}</Text>
</View>
</View>
<View>
<Text
style={{
margin: 10,
marginTop: 0,
marginBottom: 10,
fontSize: 20,
color: "#CC1A17"
}}
>
{info.nome}
</Text>
<View style={{margin: 10}}>
<Text
style={{fontSize: 15, color: "#CC1A17", fontWeight: "bold"}}
>
Descrição:
</Text>
<Divider style={{backgroundColor: "#000"}}/>
<View style={{marginTop: 10}}>
<Text>{info.desc}</Text>
</View>
<Text
style={{fontSize: 15, color: "#CC1A17", fontWeight: "bold", marginTop: 10}}
>
Como posso participar?
</Text>
<Divider style={{backgroundColor: "#000"}}/>
<View style={{marginTop: 10}}>
<Text>{info.notas}</Text>
</View>
<Text
style={{fontSize: 15, color: "#CC1A17", fontWeight: "bold", marginTop: 10}}
>
Qual é o custo de participação?
</Text>
<Divider style={{backgroundColor: "#000"}}/>
<View style={{marginTop: 10}}>
<Text>{info.custo}</Text>
</View>
</View>
</View>
</View>
</View>
);
};
_renderContainer = (info, eventType) => {
console.log("Estou aqui " + eventType)
if (eventType === "rally") {
return this._renderRally(info);
}
else if (eventType === undefined) {
return this._renderEventDetail(info);
}
};
constructor(props) {
super(props);
this.data = [];
}
render() {
const {navigation} = this.props;
const info = navigation.getParam("info", "error");
const eventType = navigation.getParam("type");
return (
<View style={styles.mainViewStyle}>
<ScrollView style={styles.scroll}>
<View style={styles.container}>
<View style={styles.headerContainer}>
<View style={styles.headerContainer}>
<View style={styles.coverContainer}>
<ImageBackground
source={{
uri: info.imagem
}}
style={styles.coverImage}
/>
</View>
</View>
</View>
{this._renderContainer(info, eventType)}
</View>
<View style={styles.block}>
<Text
style={{fontSize: 15, color: "#CC1A17", fontWeight: "bold"}}
>
Localização
</Text>
<Divider style={{backgroundColor: "#000", marginBottom: 10}}/>
<Text>{info.localizacao}</Text>
</View>
</ScrollView>
<Divider style={{backgroundColor: "black"}}/>
</View>
);
}
}
const styles = StyleSheet.create({
block: {
marginTop: 15,
backgroundColor: "white",
padding: 20,
shadowOffset: {
width: 0,
height: 2
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 3
},
AttendeeContainer: {
flexDirection: "row",
height: 55,
justifyContent: "center",
marginLeft: 10,
marginRight: 10
},
centerRow: {
alignItems: "center",
backgroundColor: "transparent",
flex: 3,
flexDirection: "column",
justifyContent: "center"
},
leftRow: {
backgroundColor: "transparent",
flex: 1,
flexDirection: "row",
justifyContent: "flex-start",
alignSelf: "center"
},
rightRow: {
alignItems: "flex-end",
backgroundColor: "transparent",
flex: 2,
flexDirection: "row",
justifyContent: "flex-end",
marginRight: 4,
alignSelf: "center"
},
icon: {
justifyContent: "flex-start",
marginTop: 2.8
},
nameAttendee: {
alignSelf: "center",
fontSize: 20,
fontWeight: "400",
color: "#000",
marginBottom: 10
},
details: {
marginTop: 20,
flex: 1,
alignSelf: "center"
},
infoRow: {
margin: 25
},
ramoText: {
alignSelf: "flex-start",
marginBottom: 5,
color: "white",
fontSize: 17,
fontWeight: "400"
},
timeText: {
alignItems: "flex-end",
flex: 2,
lineHeight: 10,
marginRight: 20
},
mainViewStyle: {
flex: 1,
flexGrow: 1,
flexDirection: "column"
},
scroll: {
backgroundColor: "#eee",
flex: 1
//marginBottom: 55,
},
header: {
flex: 1,
padding: 10,
backgroundColor: "white",
borderRadius: 0,
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 2
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 3
},
cardContainer: {
flex: 1,
padding: 10,
// margin: 20,
backgroundColor: "white",
borderRadius: 5
},
headerContainer: {
flex: 1
},
container: {
flex: 1,
flexDirection: "column"
},
coverContainer: {
position: "relative"
},
coverImage: {
height: Dimensions.get("window").width * (2 / 4),
width: Dimensions.get("window").width
},
/*headerContainer: {
alignItems: 'center',
backgroundColor: '#FFF',
},*/
carreerPathContainer: {
backgroundColor: "#CC1A17",
height: 50,
flex: 1,
alignItems: "center",
justifyContent: "center",
paddingTop: 15
},
carreerPathText: {
height: 50,
color: "white",
fontWeight: "bold",
fontSize: 20
},
companyHeader: {
backgroundColor: "#dddddd",
// height:150,
borderRadius: 5,
margin: 10,
padding: 10
},
companyTitle: {
paddingBottom: 5,
fontWeight: "bold",
color: "#777777",
fontSize: 17
// padding:20
},
companyLogo: {
borderRadius: 20
},
wrapper: {},
company: {
flex: 1,
flexDirection: "row",
// backgroundColor:'red',
color: "black"
},
companyLogoContainer: {
flex: 1,
justifyContent: "center",
width: "60%",
// backgroundColor:'white',
margin: 20
},
aboutCompany: {
width: SCREEN_WIDTH,
flex: 1,
justifyContent: "center",
alignItems: "center"
}
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
careerPath: state.apiReducer.careerPath,
sessionDetail: state.apiReducer.sessionDetail
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(event);

View File

@ -228,7 +228,8 @@ class eventDetail extends React.Component {
const { navigation } = this.props;
const info = navigation.getParam("info", "error");
const eventType = navigation.getParam("type");
console.log(info)
if(info!= undefined)
return (
<View style={styles.mainViewStyle}>
<ScrollView style={styles.scroll}>

View File

@ -8,6 +8,7 @@ export const GET_CROMOS='GET_CROMOS'
export const GET_LOCS_VISITED= 'GET_LOCS_VISITED'
export const SCAN_QR = 'SCAN_QR'
export const LOGIN_INTERNAL ='LOGIN_INTERNAL'
export const CHANGE_PASSWORD='CHANGE_PASSWORD'
//API BLUETREND

View File

@ -31,7 +31,8 @@ import {
GET_CROMOS,
GET_LOCS_VISITED,
SCAN_QR,
LOGIN_INTERNAL
LOGIN_INTERNAL,
CHANGE_PASSWORD
} from "./actionTypes"; //Import the actions types constant we defined in our actions
import moment from "moment";
@ -71,6 +72,14 @@ export function scanQrCode(data, tokenInternal) {
};
}
export function changeTeamName(){
axios.defaults.headers.common = {
Authorization: `bearer ${tokenInternal}`
};
axios.defaults.baseURL = "https://api.enei.pt/api";
}
export function getEventLocsVisited(teamId, tokenInternal) {
axios.defaults.headers.common = {
Authorization: `bearer ${tokenInternal}`
@ -90,7 +99,7 @@ export function getEventLocsVisited(teamId, tokenInternal) {
})
.catch(p => {
console.log(p);
Alert.alert("ERRO!", "erro a obter os locais visitados");
// Alert.alert("ERRO!", "erro a obter os locais visitados");
});
};
}
@ -662,6 +671,9 @@ export function changePassword(token, old, new1, new2) {
NewPassword: new1
})
.then(a => {
dispatch({
type: CHANGE_PASSWORD
});
Alert.alert("Sucesso!", "Password alterada com sucesso");
})
.catch(p => {
@ -1703,7 +1715,7 @@ export function getUserInfo(token) {
})
.catch(p => {
console.log(p);
Alert.alert("ERRO!", "erro a obter os locais visitados");
// Alert.alert("ERRO!", "erro a obter os locais visitados");
});
dispatch({

View File

@ -25,7 +25,8 @@ CREATE_TEAM,
GET_CROMOS,
GET_LOCS_VISITED,
SCAN_QR,
LOGIN_INTERNAL
LOGIN_INTERNAL,
CHANGE_PASSWORD
} from "../actions/actionTypes"; //Import the actions types constant we defined in our actions
import { REHYDRATE } from "redux-persist";
@ -138,6 +139,10 @@ const apiReducer = (state = apiState, action) => {
locais: action.locais
});
case CHANGE_PASSWORD:
return Object.assign({}, state, {
onHold: false
});
case "CHANGE_CONNECTION_STATUS":
return Object.assign({}, state, {
isConnected: action.isConnected