Correction de bugs
This commit is contained in:
parent
210d09c49f
commit
5bfad5f025
|
@ -1,9 +1,28 @@
|
||||||
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 = () => ({
|
||||||
|
@ -47,7 +66,7 @@ export const fetchEnvoieUserWalletToWalleGetCommissiontReset = (error) => ({
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
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) => ({
|
||||||
|
@ -60,7 +79,7 @@ export const fetchEnvoieUserWalletToCashError = (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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
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,
|
||||||
|
@ -8,23 +13,27 @@ const initialState = {
|
||||||
|
|
||||||
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:
|
||||||
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: true
|
loading: true
|
||||||
}
|
}
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS: return {
|
case ENVOIE_WALLET_TO_CASH_USER_SUCCESS:
|
||||||
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: false,
|
loading: false,
|
||||||
result: action.result.data,
|
result: action.result.data,
|
||||||
error: null
|
error: null
|
||||||
}
|
}
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_ERROR: return {
|
case ENVOIE_WALLET_TO_CASH_USER_ERROR:
|
||||||
|
return {
|
||||||
...state,
|
...state,
|
||||||
loading: false,
|
loading: false,
|
||||||
result: null,
|
result: null,
|
||||||
error: action.result
|
error: action.result
|
||||||
}
|
}
|
||||||
case ENVOIE_WALLET_TO_CASH_USER_PENDING: return initialState;
|
case ENVOIE_WALLET_TO_CASH_USER_RESET:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
return state;
|
return state;
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
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,
|
||||||
|
@ -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'
|
||||||
|
}} textStyle={{color: "white", fontSize: 20, fontWeight: 'bold'}}
|
||||||
|
onPress={() => this.onClickUpdatePosition()}>{I18n.t('UPDATE_POSITION_TEXT')}</Button>
|
||||||
</View>);
|
</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
|
||||||
|
case -2:
|
||||||
|
message = I18n.t('TEXT_UDATE_POSITION_FAILED_2');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Alert.alert(title,message,[{text:"Ok",onPress:()=>{
|
Alert.alert(title, message, [{
|
||||||
|
text: "Ok", onPress: () => {
|
||||||
this.props.navigation.popToTop()
|
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={() => {
|
||||||
|
|
||||||
|
|
|
@ -2,28 +2,45 @@ import DateTimePicker from '@react-native-community/datetimepicker';
|
||||||
import Button from 'apsl-react-native-button';
|
import Button from 'apsl-react-native-button';
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import isNil from 'lodash/isNil';
|
import isNil from 'lodash/isNil';
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { Alert, Keyboard, PermissionsAndroid, Platform, ProgressBarAndroid, ScrollView, StyleSheet, Text, View } from 'react-native';
|
import {
|
||||||
|
Alert,
|
||||||
|
Keyboard,
|
||||||
|
PermissionsAndroid,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import Geolocation from 'react-native-geolocation-service';
|
import Geolocation from 'react-native-geolocation-service';
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import { MaterialDialog } from "react-native-material-dialog";
|
import {MaterialDialog} from "react-native-material-dialog";
|
||||||
import { Dropdown } from 'react-native-material-dropdown';
|
import {Dropdown} from 'react-native-material-dropdown';
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||||
import { Fumi } from 'react-native-textinput-effects';
|
import {Fumi} from 'react-native-textinput-effects';
|
||||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||||
import { connect } from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import { Color } from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import { store } from '../../redux/store';
|
import {store} from '../../redux/store';
|
||||||
import { identityPieces } from '../../utils/UtilsFunction';
|
import {identityPieces} from '../../utils/UtilsFunction';
|
||||||
import { createIndentificationResetAction, getNumberDetailAction, getNumberResetAction, getUserIdentificationAction, updateIndentificationAction } from '../../webservice/IdentificationApi';
|
import {
|
||||||
import { getListCountriesActive, getTownInformationName, readUser } from './../../webservice/AuthApi';
|
createIndentificationResetAction,
|
||||||
import { getPositionInformation } from './../../webservice/MapService';
|
getNumberDetailAction,
|
||||||
|
getNumberResetAction,
|
||||||
|
getUserIdentificationAction,
|
||||||
|
updateIndentificationAction
|
||||||
|
} from '../../webservice/IdentificationApi';
|
||||||
|
import {getListCountriesActive, getTownInformationName, readUser} from './../../webservice/AuthApi';
|
||||||
|
import {getPositionInformation} from './../../webservice/MapService';
|
||||||
|
|
||||||
let theme = require('./../../utils/theme.json');
|
let theme = require('./../../utils/theme.json');
|
||||||
let route = require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true };
|
const GEOLOCATION_OPTIONS = {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true};
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
|
|
||||||
class ModifyIdentificationUser extends Component {
|
class ModifyIdentificationUser extends Component {
|
||||||
|
@ -93,8 +110,8 @@ class ModifyIdentificationUser extends Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
this.dateNaissanceFumiProps.value = moment(this.state.userIdentificationData.birth_date).format('DD-MM-YYYY');
|
this.dateNaissanceFumiProps.value = this.state.userIdentificationData !== null ? moment(this.state.userIdentificationData.birth_date).format('DD-MM-YYYY') : "";
|
||||||
this.dateExpirationFumiProps.value = moment(this.state.userIdentificationData.expiry_date_document).format('DD-MM-YYYY');
|
this.dateExpirationFumiProps.value = this.state.userIdentificationData !== null ? moment(this.state.userIdentificationData.expiry_date_document).format('DD-MM-YYYY') : "";
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
|
@ -118,7 +135,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderCreateIdentificationResponse() {
|
renderCreateIdentificationResponse() {
|
||||||
const { result, error } = this.props;
|
const {result, error} = this.props;
|
||||||
|
|
||||||
console.log("PROPS", this.props);
|
console.log("PROPS", this.props);
|
||||||
|
|
||||||
|
@ -132,13 +149,13 @@ class ModifyIdentificationUser extends Component {
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.getUserIdentificationAction(this.state.user.phone);
|
this.props.getUserIdentificationAction(this.state.user.phone);
|
||||||
this.props.createIndentificationResetAction();
|
this.props.createIndentificationResetAction();
|
||||||
this.setState({ triggerSubmitClick: false });
|
this.setState({triggerSubmitClick: false});
|
||||||
this.props.navigation.pop();
|
this.props.navigation.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,12 +169,12 @@ class ModifyIdentificationUser extends Component {
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.createIndentificationResetAction();
|
this.props.createIndentificationResetAction();
|
||||||
this.setState({ triggerSubmitClick: false });
|
this.setState({triggerSubmitClick: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
|
@ -171,7 +188,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,13 +209,17 @@ class ModifyIdentificationUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
showErrorDialog() {
|
showErrorDialog() {
|
||||||
this.setState({ modalDialog: false })
|
this.setState({modalDialog: false})
|
||||||
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," +
|
||||||
"et que vous êtes connecté à internet puis ressayer", [{
|
"et que vous êtes connecté à internet puis ressayer", [{
|
||||||
text: "Recommencer", onPress: () => {
|
text: "Recommencer", onPress: () => {
|
||||||
this.watchLocation()
|
this.watchLocation()
|
||||||
}
|
}
|
||||||
}, { text: "Annuler", onPress: () => { this.props.navigation.popToTop() } }])
|
}, {
|
||||||
|
text: "Annuler", onPress: () => {
|
||||||
|
this.props.navigation.popToTop()
|
||||||
|
}
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
async watchLocation() {
|
async watchLocation() {
|
||||||
|
@ -208,7 +229,11 @@ class ModifyIdentificationUser extends Component {
|
||||||
this.showErrorDialog()
|
this.showErrorDialog()
|
||||||
}, this.props.geolocationOptions);
|
}, this.props.geolocationOptions);
|
||||||
if (!this.watchID) {
|
if (!this.watchID) {
|
||||||
Geolocation.watchPosition((position) => { this.treatPosition(position) }, (e) => { this.showErrorDialog() }, this.props.geolocationOptions)
|
Geolocation.watchPosition((position) => {
|
||||||
|
this.treatPosition(position)
|
||||||
|
}, (e) => {
|
||||||
|
this.showErrorDialog()
|
||||||
|
}, this.props.geolocationOptions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +250,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||||
this.watchLocation();
|
this.watchLocation();
|
||||||
} else {
|
} else {
|
||||||
this.setState({ modalDialog: false })
|
this.setState({modalDialog: false})
|
||||||
Alert.alert("Echec à l'autorisation",
|
Alert.alert("Echec à l'autorisation",
|
||||||
"L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision",
|
"L'application n'est pas autorisé à acceder à votre position veuillez verifier que votre GPS est activé et configurer en mode Haute Precision",
|
||||||
[{
|
[{
|
||||||
|
@ -235,7 +260,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.setState({ modalDialog: false })
|
this.setState({modalDialog: false})
|
||||||
Alert.alert("Une erreur est Survenue",
|
Alert.alert("Une erreur est Survenue",
|
||||||
"Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application",
|
"Une erreur est survenu lors du demarrage de l'application veuillez relancer l'application",
|
||||||
[{
|
[{
|
||||||
|
@ -255,8 +280,8 @@ class ModifyIdentificationUser extends Component {
|
||||||
if (response.results !== undefined) {
|
if (response.results !== undefined) {
|
||||||
if (response.results.length > 0) {
|
if (response.results.length > 0) {
|
||||||
let most = response.results[0]
|
let most = response.results[0]
|
||||||
let { address_components, formatted_address, place_id } = most
|
let {address_components, formatted_address, place_id} = most
|
||||||
this.setState({ address: address_components, textadress: formatted_address, place: place_id })
|
this.setState({address: address_components, textadress: formatted_address, place: place_id})
|
||||||
|
|
||||||
let results = response.results;
|
let results = response.results;
|
||||||
let shortcountry;
|
let shortcountry;
|
||||||
|
@ -266,10 +291,10 @@ class ModifyIdentificationUser extends Component {
|
||||||
if (results[0].address_components[i].types[j] === "country") {
|
if (results[0].address_components[i].types[j] === "country") {
|
||||||
mcountry = results[0].address_components[i];
|
mcountry = results[0].address_components[i];
|
||||||
shortcountry = mcountry.short_name;
|
shortcountry = mcountry.short_name;
|
||||||
this.setState({ shortCountry: mcountry.short_name, longCountry: mcountry.long_name })
|
this.setState({shortCountry: mcountry.short_name, longCountry: mcountry.long_name})
|
||||||
} else if (results[0].address_components[i].types[j] === "locality") {
|
} else if (results[0].address_components[i].types[j] === "locality") {
|
||||||
const name = results[0].address_components[i].short_name;
|
const name = results[0].address_components[i].short_name;
|
||||||
this.setState({ townName: name });
|
this.setState({townName: name});
|
||||||
getTownInformationName(name).then((result) => {
|
getTownInformationName(name).then((result) => {
|
||||||
let town = null;
|
let town = null;
|
||||||
if (result instanceof Array) {
|
if (result instanceof Array) {
|
||||||
|
@ -278,24 +303,24 @@ class ModifyIdentificationUser extends Component {
|
||||||
town = result;
|
town = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({ modalVisible: false, town: new Array(town) });
|
this.setState({modalVisible: false, town: new Array(town)});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getListCountriesActive().then((cnt) => {
|
getListCountriesActive().then((cnt) => {
|
||||||
this.setState({ countries: cnt })
|
this.setState({countries: cnt})
|
||||||
console.debug(cnt, shortcountry);
|
console.debug(cnt, shortcountry);
|
||||||
var found = false
|
var found = false
|
||||||
for (let i of cnt) {
|
for (let i of cnt) {
|
||||||
if (i.code_country === shortcountry) {
|
if (i.code_country === shortcountry) {
|
||||||
found = true;
|
found = true;
|
||||||
this.setState({ modalVisible: false, indicatif: i.code_dial, country: i.name })
|
this.setState({modalVisible: false, indicatif: i.code_dial, country: i.name})
|
||||||
/* this.getNetworks(i.code_dial); */
|
/* this.getNetworks(i.code_dial); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{ text: "OK" }]);
|
Alert.alert("Impossible de recupérer vos informations", "Nous n'avons pas pu recuperer les informations de votre pays veuillez contacter les administrateurs", [{text: "OK"}]);
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -307,7 +332,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.showErrorDialog()
|
this.showErrorDialog()
|
||||||
});
|
});
|
||||||
this.setState({ myPosition: myPosition });
|
this.setState({myPosition: myPosition});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -335,7 +360,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmitIdentityClient = () => {
|
onSubmitIdentityClient = () => {
|
||||||
const { lastname, numeroIdentite, dateNaissance, dateExpiration, country, townName, identityPiecesName } = this.state;
|
const {lastname, numeroIdentite, dateNaissance, dateExpiration, country, townName, identityPiecesName} = this.state;
|
||||||
|
|
||||||
if (this.ckeckIfFieldIsOK(lastname))
|
if (this.ckeckIfFieldIsOK(lastname))
|
||||||
this.lastnameAnim.shake(800);
|
this.lastnameAnim.shake(800);
|
||||||
|
@ -377,9 +402,9 @@ class ModifyIdentificationUser extends Component {
|
||||||
<MaterialDialog
|
<MaterialDialog
|
||||||
visible={this.state.modalVisible}
|
visible={this.state.modalVisible}
|
||||||
title={I18n.t("LOADING_INFO")}>
|
title={I18n.t("LOADING_INFO")}>
|
||||||
<View style={{ justifyContent: 'center', alignItems: 'center' }}>
|
<View style={{justifyContent: 'center', alignItems: 'center'}}>
|
||||||
<Text>{I18n.t("LOADING_DESCRIPTION_COUNTRY")}</Text>
|
<Text>{I18n.t("LOADING_DESCRIPTION_COUNTRY")}</Text>
|
||||||
<ProgressBarAndroid />
|
<ProgressBarAndroid/>
|
||||||
</View>
|
</View>
|
||||||
</MaterialDialog>)
|
</MaterialDialog>)
|
||||||
}
|
}
|
||||||
|
@ -426,7 +451,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
console.log("STATE", this.state);
|
console.log("STATE", this.state);
|
||||||
const { showPickerDateNaissance } = this.state;
|
const {showPickerDateNaissance} = this.state;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.state.showPickerDateNaissance && this.renderDateNaissancePicker()}
|
{this.state.showPickerDateNaissance && this.renderDateNaissancePicker()}
|
||||||
|
@ -436,21 +461,25 @@ class ModifyIdentificationUser extends Component {
|
||||||
{this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
|
{this.state.triggerSubmitClick && this.renderCreateIdentificationResponse()}
|
||||||
<ScrollView style={styles.container}>
|
<ScrollView style={styles.container}>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.lastnameAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.lastnameAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||||
label={`${I18n.t('NAME')} ${I18n.t('AND')} ${I18n.t('FIRSTNAME')}`}
|
label={`${I18n.t('NAME')} ${I18n.t('AND')} ${I18n.t('FIRSTNAME')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.lastname}
|
value={this.state.lastname}
|
||||||
onChangeText={(lastname) => {
|
onChangeText={(lastname) => {
|
||||||
this.setState({ lastname })
|
this.setState({lastname})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.datenaissanceAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.datenaissanceAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar'}
|
||||||
label={I18n.t('DATE_NAISSANCE')}
|
label={I18n.t('DATE_NAISSANCE')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
@ -458,13 +487,15 @@ class ModifyIdentificationUser extends Component {
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
Keyboard.dismiss();
|
Keyboard.dismiss();
|
||||||
this.setState({ showPickerDateNaissance: true })
|
this.setState({showPickerDateNaissance: true})
|
||||||
}}
|
}}
|
||||||
{...this.dateNaissanceFumiProps}>
|
{...this.dateNaissanceFumiProps}>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.countryAnim = comp }}
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.countryAnim = comp
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -482,14 +513,20 @@ class ModifyIdentificationUser extends Component {
|
||||||
value={this.state.country === null ? "" :
|
value={this.state.country === null ? "" :
|
||||||
this.state.country}
|
this.state.country}
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ country: value });
|
this.setState({country: value});
|
||||||
|
}}
|
||||||
|
valueExtractor={(value) => {
|
||||||
|
return value.name
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return value.name
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
|
||||||
labelExtractor={(value) => { return value.name }}
|
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.townAnim = comp }}
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.townAnim = comp
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -507,14 +544,20 @@ class ModifyIdentificationUser extends Component {
|
||||||
value={this.state.townName === null ? "" :
|
value={this.state.townName === null ? "" :
|
||||||
this.state.townName}
|
this.state.townName}
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ townName: value });
|
this.setState({townName: value});
|
||||||
|
}}
|
||||||
|
valueExtractor={(value) => {
|
||||||
|
return value.name
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return value.name
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
|
||||||
labelExtractor={(value) => { return value.name }}
|
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.identityPiecesAnim = comp }}
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.identityPiecesAnim = comp
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -531,26 +574,34 @@ class ModifyIdentificationUser extends Component {
|
||||||
useNativeDriver={true}
|
useNativeDriver={true}
|
||||||
value={this.state.identityPiecesName}
|
value={this.state.identityPiecesName}
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({identityPiecesName: value});
|
||||||
|
}}
|
||||||
|
valueExtractor={(value) => {
|
||||||
|
return I18n.t(value.name)
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return I18n.t(value.name)
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return I18n.t(value.name) }}
|
|
||||||
labelExtractor={(value) => { return I18n.t(value.name) }}
|
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.numeroIdentiteAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.numeroIdentite}
|
value={this.state.numeroIdentite}
|
||||||
onChangeText={(numeroIdentite) => {
|
onChangeText={(numeroIdentite) => {
|
||||||
this.setState({ numeroIdentite })
|
this.setState({numeroIdentite})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.identityDateExpiryAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.identityDateExpiryAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar-times-o'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'calendar-times-o'}
|
||||||
label={I18n.t('IDENTITY_PIECE_EXPIRY_DATE')}
|
label={I18n.t('IDENTITY_PIECE_EXPIRY_DATE')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
@ -558,7 +609,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
Keyboard.dismiss();
|
Keyboard.dismiss();
|
||||||
this.setState({ showPickerDateExpiration: true })
|
this.setState({showPickerDateExpiration: true})
|
||||||
}}
|
}}
|
||||||
{...this.dateExpirationFumiProps}>
|
{...this.dateExpirationFumiProps}>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
|
@ -567,7 +618,9 @@ class ModifyIdentificationUser extends Component {
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
isLoading={this.state.isLoging}
|
isLoading={this.state.isLoging}
|
||||||
onPress={() => { this.onSubmitIdentityClient() }}>
|
onPress={() => {
|
||||||
|
this.onSubmitIdentityClient()
|
||||||
|
}}>
|
||||||
{I18n.t('MODIFY')}</Button>
|
{I18n.t('MODIFY')}</Button>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -1,27 +1,40 @@
|
||||||
import Button from 'apsl-react-native-button';
|
import Button from 'apsl-react-native-button';
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import isNil from 'lodash/isNil';
|
import isNil from 'lodash/isNil';
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import Dialog from "react-native-dialog";
|
import Dialog from "react-native-dialog";
|
||||||
import { Dropdown } from 'react-native-material-dropdown';
|
import {Dropdown} from 'react-native-material-dropdown';
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||||
import { Fumi } from 'react-native-textinput-effects';
|
import {Fumi} from 'react-native-textinput-effects';
|
||||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||||
import { connect } from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import { Color } from '../../../config/Color';
|
import {Color} from '../../../config/Color';
|
||||||
import { store } from "../../../redux/store";
|
import {store} from "../../../redux/store";
|
||||||
import { identityPieces, isIlinkWorldWallet, isNormalInteger, typeIdIDestinataire, thousandsSeparators } from '../../../utils/UtilsFunction';
|
import {identityPieces, isNormalInteger} from '../../../utils/UtilsFunction';
|
||||||
import { readUser } from '../../../webservice/AuthApi';
|
import {readUser} from '../../../webservice/AuthApi';
|
||||||
import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, getPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi';
|
import {
|
||||||
import { envoieUserWalletToCashAction, envoieUserWalletToCashReset, getCommissionUserWalletToCashAction, getCommissionUserWalletToCashReset } from '../../../webservice/EnvoieUserApi';
|
getActiveCountryAction,
|
||||||
import { Typography, FontWeight } from '../../../config/typography';
|
getActiveCountryByDialCodeAction,
|
||||||
|
getActiveCountryByDialCodeReset,
|
||||||
|
getActiveCountryReset,
|
||||||
|
getPayCountryNetworkAction,
|
||||||
|
getPayCountryNetworkReset
|
||||||
|
} from '../../../webservice/CountryApi';
|
||||||
|
import {
|
||||||
|
envoieUserWalletToCashAction,
|
||||||
|
envoieUserWalletToCashReset,
|
||||||
|
getCommissionUserWalletToCashAction,
|
||||||
|
getCommissionUserWalletToCashReset
|
||||||
|
} from '../../../webservice/EnvoieUserApi';
|
||||||
|
import {FontWeight, Typography} from '../../../config/typography';
|
||||||
import thousands from 'thousands';
|
import thousands from 'thousands';
|
||||||
import { IlinkEmitter } from '../../../utils/events';
|
import {IlinkEmitter} from '../../../utils/events';
|
||||||
|
|
||||||
let theme = require('../../../utils/theme.json');
|
let theme = require('../../../utils/theme.json');
|
||||||
let route = require('../../../route.json');
|
let route = require('../../../route.json');
|
||||||
|
|
||||||
|
@ -73,7 +86,6 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
password: null,
|
password: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
user: null,
|
user: null,
|
||||||
triggerSubmitClick: false,
|
|
||||||
triggerNextClick: false,
|
triggerNextClick: false,
|
||||||
displayFirstStep: true,
|
displayFirstStep: true,
|
||||||
displaySecondStep: false,
|
displaySecondStep: false,
|
||||||
|
@ -99,7 +111,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
this.setState({ user });
|
this.setState({user});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -122,7 +134,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
renderGetActionCountryList = () => {
|
renderGetActionCountryList = () => {
|
||||||
|
|
||||||
const { resultActiveCountryList, errorActiveCountryList } = this.props;
|
const {resultActiveCountryList, errorActiveCountryList} = this.props;
|
||||||
if (resultActiveCountryList !== null) {
|
if (resultActiveCountryList !== null) {
|
||||||
if (typeof resultActiveCountryList.response !== 'undefined') {
|
if (typeof resultActiveCountryList.response !== 'undefined') {
|
||||||
|
|
||||||
|
@ -132,7 +144,10 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
paysDestinationSelect: resultActiveCountryList.response[0].name,
|
paysDestinationSelect: resultActiveCountryList.response[0].name,
|
||||||
});
|
});
|
||||||
if (this.state.hasLoadActivePayCountryNetworkList)
|
if (this.state.hasLoadActivePayCountryNetworkList)
|
||||||
this.props.getPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: resultActiveCountryList.response[0].id });
|
this.props.getPayCountryNetworkAction({
|
||||||
|
id_wallet_agent: this.state.wallet.id,
|
||||||
|
id_country: resultActiveCountryList.response[0].id
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +164,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
|
@ -163,14 +178,14 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderGetPayCountryNetworkResponse = () => {
|
renderGetPayCountryNetworkResponse = () => {
|
||||||
const { resultPayCountryNetwork, errorPayCountryNetwork } = this.props;
|
const {resultPayCountryNetwork, errorPayCountryNetwork} = this.props;
|
||||||
if (resultPayCountryNetwork !== null) {
|
if (resultPayCountryNetwork !== null) {
|
||||||
if (typeof resultPayCountryNetwork.response !== 'undefined') {
|
if (typeof resultPayCountryNetwork.response !== 'undefined') {
|
||||||
if (resultPayCountryNetwork.response.length > 0) {
|
if (resultPayCountryNetwork.response.length > 0) {
|
||||||
|
@ -180,8 +195,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
walletActifSelect: resultPayCountryNetwork.response[0].name,
|
walletActifSelect: resultPayCountryNetwork.response[0].name,
|
||||||
modalVisible: false
|
modalVisible: false
|
||||||
});
|
});
|
||||||
}
|
} else if (resultPayCountryNetwork.response.length === 0) {
|
||||||
else if (resultPayCountryNetwork.response.length === 0) {
|
|
||||||
this.setState({
|
this.setState({
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
walletActifSelect: '',
|
walletActifSelect: '',
|
||||||
|
@ -205,7 +219,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
|
@ -219,7 +233,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,7 +241,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
renderEnvoieWalletToWalletResponse = () => {
|
renderEnvoieWalletToWalletResponse = () => {
|
||||||
|
|
||||||
const { resultEnvoieWalletToCash, errorEnvoieWalletToCash } = this.props;
|
const {resultEnvoieWalletToCash, errorEnvoieWalletToCash} = this.props;
|
||||||
|
|
||||||
if (errorEnvoieWalletToCash !== null) {
|
if (errorEnvoieWalletToCash !== null) {
|
||||||
if (typeof errorEnvoieWalletToCash.data !== 'undefined') {
|
if (typeof errorEnvoieWalletToCash.data !== 'undefined') {
|
||||||
|
@ -241,7 +255,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +275,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,7 +283,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
renderDialogGetCommissionResponse = () => {
|
renderDialogGetCommissionResponse = () => {
|
||||||
|
|
||||||
const { errorEnvoieWalletToCashGetCommission } = this.props;
|
const {errorEnvoieWalletToCashGetCommission} = this.props;
|
||||||
|
|
||||||
if (errorEnvoieWalletToCashGetCommission !== null) {
|
if (errorEnvoieWalletToCashGetCommission !== null) {
|
||||||
if (typeof errorEnvoieWalletToCashGetCommission.data !== 'undefined') {
|
if (typeof errorEnvoieWalletToCashGetCommission.data !== 'undefined') {
|
||||||
|
@ -283,7 +297,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,7 +309,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
isMontantValid = () => {
|
isMontantValid = () => {
|
||||||
const { montant } = this.state;
|
const {montant} = this.state;
|
||||||
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
||||||
return {
|
return {
|
||||||
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
||||||
|
@ -336,32 +350,35 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
<View>
|
<View>
|
||||||
|
|
||||||
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{flex: 1}}>
|
||||||
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{flex: 1}}>
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ paddingVertical: 10 }}>
|
<View style={{paddingVertical: 10}}>
|
||||||
<View style={{ paddingVertical: 10 }}>
|
<View style={{paddingVertical: 10}}>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{flex: 1}}>
|
||||||
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
|
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}}`}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -372,7 +389,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
isModalConfirmVisible: false
|
isModalConfirmVisible: false
|
||||||
});
|
});
|
||||||
}} />
|
}}/>
|
||||||
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
|
@ -397,7 +414,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
password: this.state.password
|
password: this.state.password
|
||||||
});
|
});
|
||||||
this.props.getCommissionUserWalletToCashReset();
|
this.props.getCommissionUserWalletToCashReset();
|
||||||
}} />
|
}}/>
|
||||||
|
|
||||||
</Dialog.Container>
|
</Dialog.Container>
|
||||||
|
|
||||||
|
@ -407,7 +424,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
onSubmitNextStep = () => {
|
onSubmitNextStep = () => {
|
||||||
|
|
||||||
const { nomsEmetteur, prenomsEmetteur, emailEmetteur, numeroIdentiteEmetteur } = this.state;
|
const {nomsEmetteur, prenomsEmetteur, emailEmetteur, numeroIdentiteEmetteur} = this.state;
|
||||||
|
|
||||||
if (this.ckeckIfFieldIsOK(nomsEmetteur))
|
if (this.ckeckIfFieldIsOK(nomsEmetteur))
|
||||||
this.nomsEmetteurAnim.shake(800);
|
this.nomsEmetteurAnim.shake(800);
|
||||||
|
@ -434,7 +451,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmitCashVersAutreWallet = () => {
|
onSubmitCashVersAutreWallet = () => {
|
||||||
const { nomsDestinataire, prenomsDestinataire, montant, password, numeroIdentiteDestinataire } = this.state;
|
const {nomsDestinataire, prenomsDestinataire, montant, password, numeroIdentiteDestinataire} = this.state;
|
||||||
|
|
||||||
if (this.ckeckIfFieldIsOK(nomsDestinataire))
|
if (this.ckeckIfFieldIsOK(nomsDestinataire))
|
||||||
this.nomDestinataireAnim.shake(800);
|
this.nomDestinataireAnim.shake(800);
|
||||||
|
@ -445,8 +462,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
||||||
console.log("IS MONTANT VALID", this.isMontantValid())
|
console.log("IS MONTANT VALID", this.isMontantValid())
|
||||||
this.montantAnim.shake(800);
|
this.montantAnim.shake(800);
|
||||||
}
|
} else if (this.ckeckIfFieldIsOK(password))
|
||||||
else if (this.ckeckIfFieldIsOK(password))
|
|
||||||
this.passwordAnim.shake(800);
|
this.passwordAnim.shake(800);
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
@ -477,7 +493,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
console.log("STATE", this.state);
|
console.log("STATE", this.state);
|
||||||
const { resultEnvoieWalletToCashGetCommission } = this.props;
|
const {resultEnvoieWalletToCashGetCommission} = this.props;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
|
{(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
|
||||||
|
@ -497,35 +513,41 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_CASH_TO_CASH')}</Text>
|
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_CASH_TO_CASH')}</Text>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.nomsEmetteurAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.nomsEmetteurAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||||
label={`${I18n.t('NAME_EMETTEUR')}`}
|
label={`${I18n.t('NAME_EMETTEUR')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.nomsEmetteur}
|
value={this.state.nomsEmetteur}
|
||||||
onChangeText={(nomsEmetteur) => {
|
onChangeText={(nomsEmetteur) => {
|
||||||
this.setState({ nomsEmetteur })
|
this.setState({nomsEmetteur})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.prenomsEmetteurAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.prenomsEmetteurAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
||||||
label={`${I18n.t('FIRSTNAME_EMETTEUR')}`}
|
label={`${I18n.t('FIRSTNAME_EMETTEUR')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.prenomsEmetteur}
|
value={this.state.prenomsEmetteur}
|
||||||
onChangeText={(prenomsEmetteur) => {
|
onChangeText={(prenomsEmetteur) => {
|
||||||
this.setState({ prenomsEmetteur })
|
this.setState({prenomsEmetteur})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.emailEmetteurAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.emailEmetteurAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName='envelope'
|
<Fumi iconClass={FontAwesomeIcon} iconName='envelope'
|
||||||
label={I18n.t('EMAIL_EMETTEUR')}
|
label={I18n.t('EMAIL_EMETTEUR')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
@ -533,14 +555,16 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.emailEmetteur}
|
value={this.state.emailEmetteur}
|
||||||
onChangeText={(emailEmetteur) => {
|
onChangeText={(emailEmetteur) => {
|
||||||
this.setState({ emailEmetteur })
|
this.setState({emailEmetteur})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.identityPiecesEmetteurAnim = comp }}
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.identityPiecesEmetteurAnim = comp
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -557,20 +581,26 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
useNativeDriver={true}
|
useNativeDriver={true}
|
||||||
value={this.state.identityPiecesNameEmetteur}
|
value={this.state.identityPiecesNameEmetteur}
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
|
this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false});
|
||||||
|
}}
|
||||||
|
valueExtractor={(value) => {
|
||||||
|
return I18n.t(value.name)
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return I18n.t(value.name)
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return I18n.t(value.name) }}
|
|
||||||
labelExtractor={(value) => { return I18n.t(value.name) }}
|
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.numeroIdentiteEmetteurAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.numeroIdentiteEmetteurAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
|
||||||
label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`}
|
label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
onChangeText={(numeroIdentiteEmetteur) => {
|
onChangeText={(numeroIdentiteEmetteur) => {
|
||||||
this.setState({ numeroIdentiteEmetteur })
|
this.setState({numeroIdentiteEmetteur})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
|
@ -580,56 +610,66 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
isLoading={this.state.isLoging}
|
isLoading={this.state.isLoging}
|
||||||
onPress={() => { this.onSubmitNextStep() }}>
|
onPress={() => {
|
||||||
|
this.onSubmitNextStep()
|
||||||
|
}}>
|
||||||
{I18n.t('NEXT')}</Button>
|
{I18n.t('NEXT')}</Button>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
{this.state.displaySecondStep &&
|
{this.state.displaySecondStep &&
|
||||||
<>
|
<>
|
||||||
<Animatable.View ref={(comp) => { this.nomDestinataireAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.nomDestinataireAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user'}
|
||||||
label={`${I18n.t('NAME_DESTINATAIRE')}`}
|
label={`${I18n.t('NAME_DESTINATAIRE')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.nomsDestinataire}
|
value={this.state.nomsDestinataire}
|
||||||
onChangeText={(nomsDestinataire) => {
|
onChangeText={(nomsDestinataire) => {
|
||||||
this.setState({ nomsDestinataire })
|
this.setState({nomsDestinataire})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.prenomsDestinataireAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.prenomsDestinataireAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
||||||
label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`}
|
label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.prenomsDestinataire}
|
value={this.state.prenomsDestinataire}
|
||||||
onChangeText={(prenomsDestinataire) => {
|
onChangeText={(prenomsDestinataire) => {
|
||||||
this.setState({ prenomsDestinataire })
|
this.setState({prenomsDestinataire})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.identityPiecesDestinataireAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.identityPiecesDestinataireAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
|
||||||
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
label={`${I18n.t('NUMERO_IDENTITE')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.numeroIdentiteDestinataire}
|
value={this.state.numeroIdentiteDestinataire}
|
||||||
onChangeText={(numeroIdentiteDestinataire) => {
|
onChangeText={(numeroIdentiteDestinataire) => {
|
||||||
this.setState({ numeroIdentiteDestinataire })
|
this.setState({numeroIdentiteDestinataire})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }}
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.paysDestinationAnim = comp
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -649,17 +689,30 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
this.props.getPayCountryNetworkReset();
|
this.props.getPayCountryNetworkReset();
|
||||||
|
|
||||||
let countrySelect = data.filter(element => element.name === value);
|
let countrySelect = data.filter(element => element.name === value);
|
||||||
this.setState({ paysDestinationSelect: value, hasLoadActivePayCountryNetworkList: true, isDataSubmit: false }, () => {
|
this.setState({
|
||||||
this.props.getPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: countrySelect[0].id });
|
paysDestinationSelect: value,
|
||||||
|
hasLoadActivePayCountryNetworkList: true,
|
||||||
|
isDataSubmit: false
|
||||||
|
}, () => {
|
||||||
|
this.props.getPayCountryNetworkAction({
|
||||||
|
id_wallet_agent: this.state.wallet.id,
|
||||||
|
id_country: countrySelect[0].id
|
||||||
|
});
|
||||||
});
|
});
|
||||||
this.props.getCommissionUserWalletToCashReset();
|
this.props.getCommissionUserWalletToCashReset();
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => {
|
||||||
labelExtractor={(value) => { return value.name }}
|
return value.name
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return value.name
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.walletActifAnim = comp }}
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.walletActifAnim = comp
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -682,12 +735,18 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => {
|
||||||
labelExtractor={(value) => { return value.name }}
|
return value.name
|
||||||
|
}}
|
||||||
|
labelExtractor={(value) => {
|
||||||
|
return value.name
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.montantAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||||
label={I18n.t('AMOUNT')}
|
label={I18n.t('AMOUNT')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
@ -695,7 +754,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.montant}
|
value={this.state.montant}
|
||||||
onChangeText={(montant) => {
|
onChangeText={(montant) => {
|
||||||
this.setState({ montant })
|
this.setState({montant})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
|
@ -717,11 +776,14 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
<Text
|
||||||
|
style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
||||||
</View>
|
</View>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.passwordAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||||
label={I18n.t('PASSWORD')}
|
label={I18n.t('PASSWORD')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
@ -729,7 +791,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
secureTextEntry={true}
|
secureTextEntry={true}
|
||||||
value={this.state.password}
|
value={this.state.password}
|
||||||
onChangeText={(password) => {
|
onChangeText={(password) => {
|
||||||
this.setState({ password })
|
this.setState({password})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
|
@ -738,7 +800,9 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
isLoading={this.state.isLoging}
|
isLoading={this.state.isLoging}
|
||||||
onPress={() => { this.onSubmitCashVersAutreWallet() }}>
|
onPress={() => {
|
||||||
|
this.onSubmitCashVersAutreWallet()
|
||||||
|
}}>
|
||||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -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