Correction de bugs
This commit is contained in:
parent
210d09c49f
commit
5bfad5f025
|
@ -1,125 +1,144 @@
|
||||||
import {
|
import {
|
||||||
ENVOIE_WALLET_TO_WALLET_USER_PENDING, ENVOIE_WALLET_TO_WALLET_USER_SUCCESS, ENVOIE_WALLET_TO_WALLET_USER_ERROR, ENVOIE_WALLET_TO_WALLET_USER_RESET, ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_ERROR,
|
ENVOIE_WALLET_TO_CARD_USER_ERROR,
|
||||||
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_PENDING, ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_SUCCESS, ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_RESET, ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING, ENVOIE_WALLET_TO_CASH_USER_SUCCESS, ENVOIE_WALLET_TO_CASH_USER_ERROR, ENVOIE_WALLET_TO_CASH_USER_RESET,
|
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR,
|
||||||
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_SUCCESS, ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_ERROR, ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_RESET,
|
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING,
|
||||||
ENVOIE_WALLET_TO_CARD_USER_PENDING, ENVOIE_WALLET_TO_CARD_USER_SUCCESS, ENVOIE_WALLET_TO_CARD_USER_ERROR, ENVOIE_WALLET_TO_CARD_USER_RESET,
|
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET,
|
||||||
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING, ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS, ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR, ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET
|
ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS,
|
||||||
|
ENVOIE_WALLET_TO_CARD_USER_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_CARD_USER_RESET,
|
||||||
|
ENVOIE_WALLET_TO_CARD_USER_SUCCESS,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_RESET,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_SUCCESS,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_RESET,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_SUCCESS,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_RESET,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_SUCCESS,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_RESET,
|
||||||
|
ENVOIE_WALLET_TO_WALLET_USER_SUCCESS
|
||||||
} from "../types/EnvoieUserType";
|
} from "../types/EnvoieUserType";
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalletPending = () => ({
|
export const fetchEnvoieUserWalletToWalletPending = () => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_PENDING
|
type: ENVOIE_WALLET_TO_WALLET_USER_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalletSuccess = (res) => ({
|
export const fetchEnvoieUserWalletToWalletSuccess = (res) => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_SUCCESS,
|
type: ENVOIE_WALLET_TO_WALLET_USER_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalletError = (error) => ({
|
export const fetchEnvoieUserWalletToWalletError = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_ERROR,
|
type: ENVOIE_WALLET_TO_WALLET_USER_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalletReset = (error) => ({
|
export const fetchEnvoieUserWalletToWalletReset = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_RESET
|
type: ENVOIE_WALLET_TO_WALLET_USER_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
/****************/
|
/****************/
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalleGetCommissiontPending = () => ({
|
export const fetchEnvoieUserWalletToWalleGetCommissiontPending = () => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_PENDING
|
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalletGetCommissionSuccess = (res) => ({
|
export const fetchEnvoieUserWalletToWalletGetCommissionSuccess = (res) => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_SUCCESS,
|
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalletGetCommissionError = (error) => ({
|
export const fetchEnvoieUserWalletToWalletGetCommissionError = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_ERROR,
|
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToWalleGetCommissiontReset = (error) => ({
|
export const fetchEnvoieUserWalletToWalleGetCommissiontReset = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_RESET
|
type: ENVOIE_WALLET_TO_WALLET_USER_GET_COMMISSION_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashPending = () => ({
|
export const fetchEnvoieUserWalletToCashPending = () => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING
|
type: ENVOIE_WALLET_TO_CASH_USER_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashSuccess = (res) => ({
|
export const fetchEnvoieUserWalletToCashSuccess = (res) => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_SUCCESS,
|
type: ENVOIE_WALLET_TO_CASH_USER_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashError = (error) => ({
|
export const fetchEnvoieUserWalletToCashError = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_ERROR,
|
type: ENVOIE_WALLET_TO_CASH_USER_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashReset = (error) => ({
|
export const fetchEnvoieUserWalletToCashReset = () => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_RESET
|
type: ENVOIE_WALLET_TO_CASH_USER_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
/****************/
|
/****************/
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashGetCommissiontPending = () => ({
|
export const fetchEnvoieUserWalletToCashGetCommissiontPending = () => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING
|
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashGetCommissionSuccess = (res) => ({
|
export const fetchEnvoieUserWalletToCashGetCommissionSuccess = (res) => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_SUCCESS,
|
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashGetCommissionError = (error) => ({
|
export const fetchEnvoieUserWalletToCashGetCommissionError = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_ERROR,
|
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCashGetCommissiontReset = (error) => ({
|
export const fetchEnvoieUserWalletToCashGetCommissiontReset = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_RESET
|
type: ENVOIE_WALLET_TO_CASH_USER_GET_COMMISSION_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardPending = () => ({
|
export const fetchEnvoieUserWalletToCardPending = () => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_PENDING
|
type: ENVOIE_WALLET_TO_CARD_USER_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardSuccess = (res) => ({
|
export const fetchEnvoieUserWalletToCardSuccess = (res) => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_SUCCESS,
|
type: ENVOIE_WALLET_TO_CARD_USER_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardError = (error) => ({
|
export const fetchEnvoieUserWalletToCardError = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_ERROR,
|
type: ENVOIE_WALLET_TO_CARD_USER_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardReset = (error) => ({
|
export const fetchEnvoieUserWalletToCardReset = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_RESET
|
type: ENVOIE_WALLET_TO_CARD_USER_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
/****************/
|
/****************/
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardGetCommissiontPending = () => ({
|
export const fetchEnvoieUserWalletToCardGetCommissiontPending = () => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING
|
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardGetCommissionSuccess = (res) => ({
|
export const fetchEnvoieUserWalletToCardGetCommissionSuccess = (res) => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS,
|
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS,
|
||||||
result: res,
|
result: res,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardGetCommissionError = (error) => ({
|
export const fetchEnvoieUserWalletToCardGetCommissionError = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR,
|
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR,
|
||||||
result: error
|
result: error
|
||||||
});
|
});
|
||||||
|
|
||||||
export const fetchEnvoieUserWalletToCardGetCommissiontReset = (error) => ({
|
export const fetchEnvoieUserWalletToCardGetCommissiontReset = (error) => ({
|
||||||
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET
|
type: ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET
|
||||||
});
|
});
|
|
@ -1,33 +1,42 @@
|
||||||
import { ENVOIE_WALLET_TO_CASH_USER_PENDING, ENVOIE_WALLET_TO_CASH_USER_SUCCESS, ENVOIE_WALLET_TO_CASH_USER_ERROR } from "../types/EnvoieUserType";
|
import {
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_RESET,
|
||||||
|
ENVOIE_WALLET_TO_CASH_USER_SUCCESS
|
||||||
|
} from "../types/EnvoieUserType";
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
loading: false,
|
loading: false,
|
||||||
result: null,
|
result: null,
|
||||||
error: null
|
error: null
|
||||||
};
|
};
|
||||||
|
|
||||||
export default (state = initialState, action) => {
|
export default (state = initialState, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return {
|
case ENVOIE_WALLET_TO_CASH_USER_PENDING:
|
||||||
...state,
|
return {
|
||||||
loading: true
|
...state,
|
||||||
}
|
loading: true
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS: return {
|
}
|
||||||
...state,
|
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS:
|
||||||
loading: false,
|
return {
|
||||||
result: action.result.data,
|
...state,
|
||||||
error: null
|
loading: false,
|
||||||
}
|
result: action.result.data,
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_ERROR: return {
|
error: null
|
||||||
...state,
|
}
|
||||||
loading: false,
|
case ENVOIE_WALLET_TO_CASH_USER_ERROR:
|
||||||
result: null,
|
return {
|
||||||
error: action.result
|
...state,
|
||||||
}
|
loading: false,
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return initialState;
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case ENVOIE_WALLET_TO_CASH_USER_RESET:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
import React,{Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {StyleSheet,View,Text,Image,StatusBar,ScrollView,Alert} from 'react-native';
|
import {Alert, View} from 'react-native';
|
||||||
let theme=require('./../../utils/theme.json');
|
import {readUser, updatePosition, updateUserData} from './../../webservice/AuthApi';
|
||||||
import {readUser,updatePosition,updateUserData} from './../../webservice/AuthApi';
|
import {responsiveHeight} from 'react-native-responsive-dimensions';
|
||||||
import {getAgentNetworksList} from './../../webservice/NetworkApi'
|
|
||||||
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
|
||||||
import MapView,{Marker} from 'react-native-maps';
|
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5'
|
import Icon from 'react-native-vector-icons/FontAwesome5'
|
||||||
import Button from 'apsl-react-native-button'
|
import Button from 'apsl-react-native-button'
|
||||||
import CardView from "react-native-cardview";
|
|
||||||
const route=require('./../../route.json')
|
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
import {Header} from "react-native-elements";
|
|
||||||
import {IlinkEmitter} from "../../utils/events";
|
import {IlinkEmitter} from "../../utils/events";
|
||||||
|
import Geolocation from 'react-native-geolocation-service';
|
||||||
|
|
||||||
|
let theme = require('./../../utils/theme.json');
|
||||||
|
|
||||||
|
const route = require('./../../route.json')
|
||||||
|
|
||||||
require('./../../utils/Translations')
|
require('./../../utils/Translations')
|
||||||
|
|
||||||
const height=responsiveHeight(100)-250;
|
const height = responsiveHeight(100) - 250;
|
||||||
export default class UpdateInformations extends Component {
|
export default class UpdateInformations extends Component {
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
navBarHidden: false,
|
navBarHidden: false,
|
||||||
navBarBackgroundColor: theme.primaryDark,
|
navBarBackgroundColor: theme.primaryDark,
|
||||||
|
@ -25,101 +25,114 @@ export default class UpdateInformations extends Component {
|
||||||
statusBarColor: theme.primaryDarkAdvanced,
|
statusBarColor: theme.primaryDarkAdvanced,
|
||||||
statusBarTextColorScheme: 'light',
|
statusBarTextColorScheme: 'light',
|
||||||
};
|
};
|
||||||
static options(passProps){
|
|
||||||
|
static options(passProps) {
|
||||||
return {
|
return {
|
||||||
statusBar:{
|
statusBar: {
|
||||||
drawBehind:false
|
drawBehind: false
|
||||||
},
|
},
|
||||||
topBar:{
|
topBar: {
|
||||||
title:{
|
title: {
|
||||||
text:"Mise à jour des informations",
|
text: "Mise à jour des informations",
|
||||||
color:"white"
|
color: "white"
|
||||||
},
|
},
|
||||||
|
|
||||||
background:{
|
background: {
|
||||||
color:theme.primaryDark
|
color: theme.primaryDark
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static navigationOptions = ({navigation})=>{
|
|
||||||
|
static navigationOptions = ({navigation}) => {
|
||||||
return {
|
return {
|
||||||
headerTitle: I18n.t('CHANGE_INFORMATION'),
|
headerTitle: I18n.t('CHANGE_INFORMATION'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({tintColor}) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'user'}
|
name={'user'}
|
||||||
size={24}
|
size={24}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}};
|
}
|
||||||
constructor(props){
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state=this.initiateItems()
|
this.state = this.initiateItems()
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
this.showUserState()
|
this.showUserState()
|
||||||
}
|
}
|
||||||
async showUserState(){
|
|
||||||
const user=await readUser()
|
async showUserState() {
|
||||||
this.setState({user:user})
|
const user = await readUser()
|
||||||
if(user.longitude<=0 && user.latitude<=0){
|
this.setState({user: user})
|
||||||
Alert.alert(I18n.t('TITLE_NEED_POSITION'),I18n.t('TEXT_NEED_POSITION'),[{text:'Ok'}])
|
if (user.longitude <= 0 && user.latitude <= 0) {
|
||||||
|
Alert.alert(I18n.t('TITLE_NEED_POSITION'), I18n.t('TEXT_NEED_POSITION'), [{text: 'Ok'}])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue(){
|
updateLangue() {
|
||||||
this.props.navigation.setParams({name:I18n.t('CHANGE_INFORMATION')})
|
this.props.navigation.setParams({name: I18n.t('CHANGE_INFORMATION')})
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
render(){
|
|
||||||
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={{flex:1,backgroundColor:theme.primary}}>
|
<View style={{flex: 1, backgroundColor: theme.primary}}>
|
||||||
<Button
|
<Button
|
||||||
isLoading={this.state.positionEnabled}
|
isLoading={this.state.positionEnabled}
|
||||||
style={{backgroundColor:theme.primaryDark,
|
style={{
|
||||||
marginTop:responsiveHeight(5),
|
backgroundColor: theme.primaryDark,
|
||||||
height:responsiveHeight(7),
|
marginTop: responsiveHeight(5),
|
||||||
marginRight:10,
|
height: responsiveHeight(7),
|
||||||
marginLeft:10,
|
marginRight: 10,
|
||||||
borderColor:'transparent'
|
marginLeft: 10,
|
||||||
}} textStyle={{color:"white",fontSize:20,fontWeight:'bold'}} onPress={()=>this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
|
borderColor: 'transparent'
|
||||||
</View>);
|
}} textStyle={{color: "white", fontSize: 20, fontWeight: 'bold'}}
|
||||||
|
onPress={() => this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
|
||||||
|
</View>);
|
||||||
}
|
}
|
||||||
|
|
||||||
initiateItems() {
|
initiateItems() {
|
||||||
return{
|
return {
|
||||||
positionEnabled:false,
|
positionEnabled: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickUpdatePosition() {
|
onClickUpdatePosition() {
|
||||||
this.setState({positionEnabled:true})
|
this.setState({positionEnabled: true})
|
||||||
navigator.geolocation.getCurrentPosition((position) => {
|
Geolocation.getCurrentPosition((position) => {
|
||||||
const myPosition = position.coords;
|
const myPosition = position.coords;
|
||||||
updatePosition(myPosition.longitude,myPosition.latitude).then((response)=> {
|
updatePosition(myPosition.longitude, myPosition.latitude).then((response) => {
|
||||||
var title='';
|
var title = '';
|
||||||
var message='';
|
var message = '';
|
||||||
this.setState({positionEnabled:false})
|
this.setState({positionEnabled: false})
|
||||||
console.log(response.error)
|
console.log(response.error)
|
||||||
if(response.error===undefined){
|
if (response.error === undefined) {
|
||||||
updateUserData({longitude:myPosition.longitude,latitude:myPosition.latitude})
|
updateUserData({longitude: myPosition.longitude, latitude: myPosition.latitude})
|
||||||
message=I18n.t('POSITION_UPDATE_SUCCESS_TEXT')
|
message = I18n.t('POSITION_UPDATE_SUCCESS_TEXT')
|
||||||
title=I18n.t('UPDATE_SUCCESS');
|
title = I18n.t('UPDATE_SUCCESS');
|
||||||
}else{
|
} else {
|
||||||
title=I18n.t("TITLE_UPDATE_POSITION_FAILED")
|
title = I18n.t("TITLE_UPDATE_POSITION_FAILED")
|
||||||
switch (response.error){
|
switch (response.error) {
|
||||||
case -3:message=I18n.t('TEXT_UDATE_POSITION_FAILED_1');break
|
case -3:
|
||||||
case -2:message=I18n.t('TEXT_UDATE_POSITION_FAILED_2');
|
message = I18n.t('TEXT_UDATE_POSITION_FAILED_1');
|
||||||
break;
|
break
|
||||||
|
case -2:
|
||||||
|
message = I18n.t('TEXT_UDATE_POSITION_FAILED_2');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Alert.alert(title,message,[{text:"Ok",onPress:()=>{
|
Alert.alert(title, message, [{
|
||||||
this.props.navigation.popToTop()
|
text: "Ok", onPress: () => {
|
||||||
}}])
|
this.props.navigation.popToTop()
|
||||||
}).catch((e)=>{
|
}
|
||||||
this.setState({positionEnabled:false})
|
}])
|
||||||
|
}).catch((e) => {
|
||||||
|
this.setState({positionEnabled: false})
|
||||||
})
|
})
|
||||||
}, null, this.props.geolocationOptions);
|
}, null, this.props.geolocationOptions);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ import {accent, primary, primaryDark, purpleLight} from './../../utils/theme.jso
|
||||||
import {PagerTabIndicator} from 'react-native-best-viewpager'
|
import {PagerTabIndicator} from 'react-native-best-viewpager'
|
||||||
import IconWithBadge from "../IconWithBadge";
|
import IconWithBadge from "../IconWithBadge";
|
||||||
import {Appbar, Divider, Menu, Provider} from 'react-native-paper';
|
import {Appbar, Divider, Menu, Provider} from 'react-native-paper';
|
||||||
import DeviceInfo from 'react-native-device-info';
|
|
||||||
|
|
||||||
var moment = require('moment-timezone');
|
var moment = require('moment-timezone');
|
||||||
const momentJS = require('moment');
|
const momentJS = require('moment');
|
||||||
|
@ -322,11 +321,11 @@ class MyHistory extends React.Component {
|
||||||
<Button onPress={this._openMenu}>Show menu</Button>
|
<Button onPress={this._openMenu}>Show menu</Button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Menu.Item onPress={() => {
|
{/* <Menu.Item onPress={() => {
|
||||||
this.setState({isSectionned: !this.state.isSectionned})
|
this.setState({isSectionned: !this.state.isSectionned})
|
||||||
this._closeMenu()
|
this._closeMenu()
|
||||||
}}
|
}}
|
||||||
title="Section"/>
|
title="Section"/>*/}
|
||||||
<Divider/>
|
<Divider/>
|
||||||
<Menu.Item onPress={() => {
|
<Menu.Item onPress={() => {
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -48,6 +48,7 @@ import {responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import {getWalletDetailActivated} from "../../webservice/WalletApi";
|
import {getWalletDetailActivated} from "../../webservice/WalletApi";
|
||||||
import {getWalletTransactionHistoryUser} from "../../webservice/WalletTransactionHistoryApi";
|
import {getWalletTransactionHistoryUser} from "../../webservice/WalletTransactionHistoryApi";
|
||||||
import {getUserIdentificationAction} from "../../webservice/IdentificationApi";
|
import {getUserIdentificationAction} from "../../webservice/IdentificationApi";
|
||||||
|
import {store} from "../../redux/store";
|
||||||
|
|
||||||
const route = require('./../../route.json');
|
const route = require('./../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
@ -64,7 +65,7 @@ class WalletOptionSelect extends Component {
|
||||||
wallet: this.props.navigation.state.params.wallet,
|
wallet: this.props.navigation.state.params.wallet,
|
||||||
lottie: this.props.navigation.state.params.lottie,
|
lottie: this.props.navigation.state.params.lottie,
|
||||||
onGoBack: this.props.navigation.state.params.onGoBack,
|
onGoBack: this.props.navigation.state.params.onGoBack,
|
||||||
isIdentified: this.props.navigation.state.params.isIdentified || null,
|
isIdentified: store.getState().getUserIdentificationReducer.result !== null ? store.getState().getUserIdentificationReducer.result.response.isIdentified : false,
|
||||||
isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
|
isNanoCredit: this.props.navigation.state.params.hasOwnProperty('isNanoCredit'),
|
||||||
user: null,
|
user: null,
|
||||||
displayModalHistory: false,
|
displayModalHistory: false,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -249,7 +249,7 @@
|
||||||
"DELETE_GROUP": "Supprimer le groupe",
|
"DELETE_GROUP": "Supprimer le groupe",
|
||||||
"CREATOR": "Créateur",
|
"CREATOR": "Créateur",
|
||||||
"NOTIFICATIONS": "Notification",
|
"NOTIFICATIONS": "Notification",
|
||||||
"NO_NOTIFICATION": "Vous n'avez aucune Fnotification",
|
"NO_NOTIFICATION": "Vous n'avez aucune notification",
|
||||||
"CONFIGURATIONS": "Configuration",
|
"CONFIGURATIONS": "Configuration",
|
||||||
"LOGOUT": "Déconnexion",
|
"LOGOUT": "Déconnexion",
|
||||||
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
||||||
|
|
Loading…
Reference in New Issue