Bank operation OK
This commit is contained in:
parent
e18dae1f0a
commit
bae9ae54f4
12
App.js
12
App.js
|
|
@ -87,6 +87,7 @@ import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
||||||
import { IlinkEmitter } from './utils/events';
|
import { IlinkEmitter } from './utils/events';
|
||||||
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
||||||
import { readUser } from './webservice/AuthApi';
|
import { readUser } from './webservice/AuthApi';
|
||||||
|
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
|
@ -149,10 +150,9 @@ const AppStack = createDrawerNavigator({
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
|
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
|
||||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||||
return (<IconWithBadge
|
return (<Icon
|
||||||
badgeCount={0}
|
|
||||||
size={20}
|
size={20}
|
||||||
name={"account-multiple-plus"}
|
name={"users-cog"}
|
||||||
color={focused ? tintColor : "grey"}
|
color={focused ? tintColor : "grey"}
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
|
|
@ -163,10 +163,9 @@ const AppStack = createDrawerNavigator({
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
tabBarLabel: I18n.t('MY_GROUP'),
|
tabBarLabel: I18n.t('MY_GROUP'),
|
||||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||||
return (<IconWithBadge
|
return (<Icon
|
||||||
badgeCount={0}
|
|
||||||
size={20}
|
size={20}
|
||||||
name={"account-multiple"}
|
name={"users"}
|
||||||
color={focused ? tintColor : "grey"}
|
color={focused ? tintColor : "grey"}
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
|
|
@ -269,6 +268,7 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
||||||
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
||||||
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
||||||
|
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
|
||||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||||
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -35,6 +35,7 @@
|
||||||
"ASK_MEMBERS": "Membership applications",
|
"ASK_MEMBERS": "Membership applications",
|
||||||
"MY_ACCOUNT": "My account",
|
"MY_ACCOUNT": "My account",
|
||||||
"WALLET": "Wallet",
|
"WALLET": "Wallet",
|
||||||
|
"NO_BANK_AVAILABLE": "No bank available",
|
||||||
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
||||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
||||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
||||||
"DESTINATAIRE": "Destinataire",
|
"DESTINATAIRE": "Destinataire",
|
||||||
"ERROR_LABEL": "Erreur",
|
"ERROR_LABEL": "Erreur",
|
||||||
|
"NO_BANK_AVAILABLE": "Aucune banque disponible",
|
||||||
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
||||||
"SUCCESS": "Succès",
|
"SUCCESS": "Succès",
|
||||||
"ETAT": "Etat",
|
"ETAT": "Etat",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
import {
|
||||||
|
GET_BANK_LIST_ERROR,
|
||||||
|
GET_BANK_LIST_PENDING,
|
||||||
|
GET_BANK_LIST_RESET,
|
||||||
|
GET_BANK_LIST_SUCCESS
|
||||||
|
} from "../types/BankType";
|
||||||
|
import {
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_RESET,
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_SUCCESS
|
||||||
|
} from "../types/EnvoieUserType";
|
||||||
|
|
||||||
|
export const fetchGetBankListPending = () => ({
|
||||||
|
type: GET_BANK_LIST_PENDING
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetBankListSucsess = (res) => ({
|
||||||
|
type: GET_BANK_LIST_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetBankListError = (error) => ({
|
||||||
|
type: GET_BANK_LIST_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetBankListReset = () => ({
|
||||||
|
type: GET_BANK_LIST_RESET
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export const fetchEnvoieWalletToBankUserPending = () => ({
|
||||||
|
type: ENVOIE_WALLET_TO_BANK_USER_PENDING
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchEnvoieWalletToBankUserSucsess = (res) => ({
|
||||||
|
type: ENVOIE_WALLET_TO_BANK_USER_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchEnvoieWalletToBankUserError = (error) => ({
|
||||||
|
type: ENVOIE_WALLET_TO_BANK_USER_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchEnvoieWalletToBankUserReset = () => ({
|
||||||
|
type: ENVOIE_WALLET_TO_BANK_USER_RESET
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
import {
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_ERROR,
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_PENDING,
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_RESET,
|
||||||
|
ENVOIE_WALLET_TO_BANK_USER_SUCCESS
|
||||||
|
} from "../types/EnvoieUserType";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (state = initialState, action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case ENVOIE_WALLET_TO_BANK_USER_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case ENVOIE_WALLET_TO_BANK_USER_SUCCESS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case ENVOIE_WALLET_TO_BANK_USER_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case ENVOIE_WALLET_TO_BANK_USER_RESET:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
import {
|
||||||
|
GET_BANK_LIST_ERROR,
|
||||||
|
GET_BANK_LIST_PENDING,
|
||||||
|
GET_BANK_LIST_RESET,
|
||||||
|
GET_BANK_LIST_SUCCESS
|
||||||
|
} from "../types/BankType";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (state = initialState, action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case GET_BANK_LIST_PENDING:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case GET_BANK_LIST_SUCCESS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case GET_BANK_LIST_ERROR:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case GET_BANK_LIST_RESET:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -42,6 +42,8 @@ import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
||||||
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
||||||
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
||||||
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
|
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
|
||||||
|
import GetBankListReducer from "./GetBankListReducer";
|
||||||
|
import EnvoieUserWalletToBank from "./EnvoieUserWalletToBankReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
|
@ -69,7 +71,6 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
countryByDialCode: CountryByDialCodeReducer,
|
countryByDialCode: CountryByDialCodeReducer,
|
||||||
envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer,
|
envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer,
|
||||||
envoieUserWalletToWalletGetCommissionReducer: EnvoieUserWalletToWalletGetCommissionReducer,
|
envoieUserWalletToWalletGetCommissionReducer: EnvoieUserWalletToWalletGetCommissionReducer,
|
||||||
countryByDialCode: CountryByDialCodeReducer,
|
|
||||||
envoieUserWalletToCashReducer: EnvoieUserWalletToCashReducer,
|
envoieUserWalletToCashReducer: EnvoieUserWalletToCashReducer,
|
||||||
envoieUserWalletToCashGetCommissionReducer: EnvoieUserWalletToCashGetCommissionReducer,
|
envoieUserWalletToCashGetCommissionReducer: EnvoieUserWalletToCashGetCommissionReducer,
|
||||||
envoieUserWalletToCardReducer: EnvoieUserWalletToCardReducer,
|
envoieUserWalletToCardReducer: EnvoieUserWalletToCardReducer,
|
||||||
|
|
@ -93,7 +94,9 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
casserEpargneUserReducer: CasserEpargneUserReducer,
|
casserEpargneUserReducer: CasserEpargneUserReducer,
|
||||||
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
||||||
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
|
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
|
||||||
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer
|
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer,
|
||||||
|
getBankListReducer: GetBankListReducer,
|
||||||
|
envoieUserWalletToBank: EnvoieUserWalletToBank
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
export const GET_BANK_LIST_PENDING = 'GET_BANK_LIST_PENDING';
|
||||||
|
export const GET_BANK_LIST_SUCCESS = 'GET_BANK_LIST_SUCCESS';
|
||||||
|
export const GET_BANK_LIST_ERROR = 'GET_BANK_LIST_ERROR';
|
||||||
|
export const GET_BANK_LIST_RESET = 'GET_BANK_LIST_RESET';
|
||||||
|
|
@ -27,3 +27,8 @@ export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING = 'ENVOIE_WALLET_
|
||||||
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS';
|
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS';
|
||||||
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR';
|
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR';
|
||||||
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET';
|
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET';
|
||||||
|
|
||||||
|
export const ENVOIE_WALLET_TO_BANK_USER_PENDING = 'ENVOIE_WALLET_TO_BANK_USER_PENDING';
|
||||||
|
export const ENVOIE_WALLET_TO_BANK_USER_SUCCESS = 'ENVOIE_WALLET_TO_BANK_USER_SUCCESS';
|
||||||
|
export const ENVOIE_WALLET_TO_BANK_USER_ERROR = 'ENVOIE_WALLET_TO_BANK_USER_ERROR';
|
||||||
|
export const ENVOIE_WALLET_TO_BANK_USER_RESET = 'ENVOIE_WALLET_TO_BANK_USER_RESET';
|
||||||
|
|
@ -43,6 +43,7 @@
|
||||||
"envoieWalletToCardUser": "envoieWalletToCardUser",
|
"envoieWalletToCardUser": "envoieWalletToCardUser",
|
||||||
"linkCard": "linkCard",
|
"linkCard": "linkCard",
|
||||||
"envoieWalletToBankUser": "envoieWalletToBankUser",
|
"envoieWalletToBankUser": "envoieWalletToBankUser",
|
||||||
|
"envoieWalletToBankAgent": "envoieWalletToBankAgent",
|
||||||
"retraitWalletVersCashUser": "retraitWalletVersCashUser",
|
"retraitWalletVersCashUser": "retraitWalletVersCashUser",
|
||||||
"retraitCarteVersCashUser": "retraitCarteVersCashUser",
|
"retraitCarteVersCashUser": "retraitCarteVersCashUser",
|
||||||
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser",
|
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { StyleSheet, View, Text, Image, StatusBar, TouchableOpacity, ScrollView, ProgressBarAndroid, Alert } from 'react-native';
|
import { StyleSheet, View, Text, Image, StatusBar, TouchableOpacity, ScrollView, ProgressBarAndroid, Alert } from 'react-native';
|
||||||
let theme = require('./../../utils/theme.json');
|
let theme = require('./../../utils/theme.json');
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||||
import { readUser, deleteUser } from './../../webservice/AuthApi';
|
import { readUser, deleteUser } from './../../webservice/AuthApi';
|
||||||
import { getAgentNetworksList } from './../../webservice/NetworkApi'
|
import { getAgentNetworksList } from './../../webservice/NetworkApi'
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
|
|
@ -184,7 +184,7 @@ export default class UserAccount extends Component {
|
||||||
{this.showPhoneSup()}
|
{this.showPhoneSup()}
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
<Icon name={"signal-cellular-4-bar"} size={18} />
|
<Icon name={"account-balance-wallet"} size={18} />
|
||||||
{" " + this.state.user.network}</Text>
|
{" " + this.state.user.network}</Text>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</CardView>
|
</CardView>
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,22 @@
|
||||||
* @format
|
* @format
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
Platform, StyleSheet, Text,
|
Alert,
|
||||||
TouchableWithoutFeedback, View, TextInput,
|
Animated,
|
||||||
Animated, Dimensions, Image, PermissionsAndroid,
|
|
||||||
AsyncStorage,
|
AsyncStorage,
|
||||||
StatusBar, TouchableNativeFeedback, TouchableOpacity, BackHandler, Alert, ProgressBarAndroid
|
BackHandler,
|
||||||
, FlatList
|
Dimensions,
|
||||||
|
FlatList,
|
||||||
|
PermissionsAndroid,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import IMap from './IMap'
|
import IMap from './IMap'
|
||||||
|
|
@ -17,8 +25,8 @@ import ActionButton from 'react-native-action-button';
|
||||||
import {CardView} from "react-native-cardview"
|
import {CardView} from "react-native-cardview"
|
||||||
import {responsiveHeight, responsiveWidth,} from 'react-native-responsive-dimensions';
|
import {responsiveHeight, responsiveWidth,} from 'react-native-responsive-dimensions';
|
||||||
import {material} from 'react-native-typography';
|
import {material} from 'react-native-typography';
|
||||||
import { getMakersFrom, loadGroupeAgent, getPositionInformation } from './../../webservice/MapService';
|
import {getMakersFrom, getPositionInformation, loadGroupeAgent} from './../../webservice/MapService';
|
||||||
import { readUser, getCountryNetwork, getPasObject } from './../../webservice/AuthApi'
|
import {getCountryNetwork, readUser} from './../../webservice/AuthApi'
|
||||||
import BaseScreen from './../BaseScreen'
|
import BaseScreen from './../BaseScreen'
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import Button from 'apsl-react-native-button'
|
import Button from 'apsl-react-native-button'
|
||||||
|
|
@ -28,23 +36,15 @@ import _ from 'lodash';
|
||||||
|
|
||||||
import Configuration from "../../webservice/persistences/Configuration";
|
import Configuration from "../../webservice/persistences/Configuration";
|
||||||
import {MaterialDialog} from "react-native-material-dialog";
|
import {MaterialDialog} from "react-native-material-dialog";
|
||||||
import { ProgressDialog, Dialog } from 'react-native-simple-dialogs';
|
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||||
const countries = require("./../../utils/country_code.json")
|
import SnapSlider from 'react-native-snap-slider'
|
||||||
import SnapSlider, { displayName } from 'react-native-snap-slider'
|
|
||||||
import call from "react-native-phone-call";
|
import call from "react-native-phone-call";
|
||||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||||
import Geolocation from 'react-native-geolocation-service';
|
import Geolocation from 'react-native-geolocation-service';
|
||||||
let geolib = require("geolib")
|
|
||||||
require('./../../utils/Translations')
|
|
||||||
import InterticielAds from './../ads/InterticielAds'
|
import InterticielAds from './../ads/InterticielAds'
|
||||||
import SnackBar from 'react-native-snackbar-component'
|
import SnackBar from 'react-native-snackbar-component'
|
||||||
const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 500, useSignificantChanges: false, distanceFilter: 0 };
|
import {FAB, Surface} from 'react-native-paper'
|
||||||
const radioOptions = [{ label: "mon Reseau", value: 0 }, { label: "Tout", value: 1 }]
|
|
||||||
const theme = require('./../../utils/theme.json');
|
|
||||||
const route = require('./../../route.json');
|
|
||||||
import { FAB, Card, Surface } from 'react-native-paper'
|
|
||||||
import BottomSheet from 'reanimated-bottom-sheet'
|
import BottomSheet from 'reanimated-bottom-sheet'
|
||||||
const { width: viewportWidth, height: viewportHeight } = Dimensions.get('window');
|
|
||||||
import MarkerManager from './../../webservice/persistences/MarkerManager'
|
import MarkerManager from './../../webservice/persistences/MarkerManager'
|
||||||
import {bindActionCreators} from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import getAuthApiKey from '../../webservice/AuthKeyApi';
|
import getAuthApiKey from '../../webservice/AuthKeyApi';
|
||||||
|
|
@ -52,9 +52,26 @@ import { connect } from 'react-redux';
|
||||||
import getWalletActivated from '../../webservice/WalletApi';
|
import getWalletActivated from '../../webservice/WalletApi';
|
||||||
import {saveOnesignalIdsAction, saveOnesignalIdsReset} from '../../webservice/OnesignalApi';
|
import {saveOnesignalIdsAction, saveOnesignalIdsReset} from '../../webservice/OnesignalApi';
|
||||||
import OneSignal from 'react-native-onesignal';
|
import OneSignal from 'react-native-onesignal';
|
||||||
import NavigationService from '../../utils/NavigationService';
|
|
||||||
import {saveOnesignalIds} from '../../webservice/IlinkConstants';
|
import {saveOnesignalIds} from '../../webservice/IlinkConstants';
|
||||||
|
|
||||||
|
const countries = require("./../../utils/country_code.json")
|
||||||
|
|
||||||
|
let geolib = require("geolib")
|
||||||
|
require('./../../utils/Translations')
|
||||||
|
|
||||||
|
const GEOLOCATION_OPTIONS = {
|
||||||
|
enableHighAccuracy: true,
|
||||||
|
timeout: 20000,
|
||||||
|
maximumAge: 500,
|
||||||
|
useSignificantChanges: false,
|
||||||
|
distanceFilter: 0
|
||||||
|
};
|
||||||
|
const radioOptions = [{label: "mon Reseau", value: 0}, {label: "Tout", value: 1}]
|
||||||
|
const theme = require('./../../utils/theme.json');
|
||||||
|
const route = require('./../../route.json');
|
||||||
|
|
||||||
|
const {width: viewportWidth, height: viewportHeight} = Dimensions.get('window');
|
||||||
|
|
||||||
|
|
||||||
const slideHeight = responsiveHeight(30) > 270 ? 270 : responsiveHeight(30)
|
const slideHeight = responsiveHeight(30) > 270 ? 270 : responsiveHeight(30)
|
||||||
//var Fabric = require('react-native-fabric');
|
//var Fabric = require('react-native-fabric');
|
||||||
|
|
@ -132,9 +149,7 @@ class Home extends BaseScreen {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.setState({isNeedLoadMore: false, isLoadingMap: false})
|
this.setState({isNeedLoadMore: false, isLoadingMap: false})
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
this.setState({isNeedLoadMore: true, isLoadingMap: false})
|
this.setState({isNeedLoadMore: true, isLoadingMap: false})
|
||||||
}
|
}
|
||||||
if (this.map) this.map.focusToUser()
|
if (this.map) this.map.focusToUser()
|
||||||
|
|
@ -283,9 +298,6 @@ class Home extends BaseScreen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
global.appHasLoaded = true;
|
|
||||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
|
||||||
/* AsyncStorage.getAllKeys((err, keys) => {
|
/* AsyncStorage.getAllKeys((err, keys) => {
|
||||||
AsyncStorage.multiGet(keys, (err, stores) => {
|
AsyncStorage.multiGet(keys, (err, stores) => {
|
||||||
stores.map((result, i, store) => {
|
stores.map((result, i, store) => {
|
||||||
|
|
@ -384,6 +396,7 @@ class Home extends BaseScreen {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_storeData = async (position) => {
|
_storeData = async (position) => {
|
||||||
try {
|
try {
|
||||||
await AsyncStorage.setItem('position', JSON.stringify(position));
|
await AsyncStorage.setItem('position', JSON.stringify(position));
|
||||||
|
|
@ -391,6 +404,7 @@ class Home extends BaseScreen {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watchLocation() {
|
watchLocation() {
|
||||||
this.watchID = Geolocation.watchPosition((position) => {
|
this.watchID = Geolocation.watchPosition((position) => {
|
||||||
const myLastPosition = this.state.myPosition;
|
const myLastPosition = this.state.myPosition;
|
||||||
|
|
@ -421,7 +435,14 @@ class Home extends BaseScreen {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.setState({ region: { latitude: myPosition.latitude, longitude: myPosition.longitude, latitudeDelta: 0.003, longitudeDelta: 0.004 } });
|
this.setState({
|
||||||
|
region: {
|
||||||
|
latitude: myPosition.latitude,
|
||||||
|
longitude: myPosition.longitude,
|
||||||
|
latitudeDelta: 0.003,
|
||||||
|
longitudeDelta: 0.004
|
||||||
|
}
|
||||||
|
});
|
||||||
this.setState({myPosition: myPosition});
|
this.setState({myPosition: myPosition});
|
||||||
if (this.map) this.map.focusToUser()
|
if (this.map) this.map.focusToUser()
|
||||||
|
|
||||||
|
|
@ -457,7 +478,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
if (pays !== null && pays !== undefined)
|
if (pays !== null && pays !== undefined)
|
||||||
|
|
@ -480,7 +505,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
if (pays !== null && pays !== undefined)
|
if (pays !== null && pays !== undefined)
|
||||||
|
|
@ -505,7 +534,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
|
|
||||||
|
|
@ -536,7 +569,11 @@ class Home extends BaseScreen {
|
||||||
|
|
||||||
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;
|
||||||
|
|
@ -569,7 +606,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
this.getPosition(options)
|
this.getPosition(options)
|
||||||
|
|
@ -586,7 +627,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
this.getPosition(options)
|
this.getPosition(options)
|
||||||
|
|
@ -853,6 +898,7 @@ class Home extends BaseScreen {
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderMarker2() {
|
_renderMarker2() {
|
||||||
let {currentMarker, myPosition} = this.state;
|
let {currentMarker, myPosition} = this.state;
|
||||||
let marker = currentMarker
|
let marker = currentMarker
|
||||||
|
|
@ -865,7 +911,12 @@ class Home extends BaseScreen {
|
||||||
var name = marker.lastname === null ? marker.adresse : marker.lastname
|
var name = marker.lastname === null ? marker.adresse : marker.lastname
|
||||||
|
|
||||||
return (<View style={{flex: 1, backgroundColor: "white"}}>
|
return (<View style={{flex: 1, backgroundColor: "white"}}>
|
||||||
<View style={{ flexDirection: "row", justifyContent: "flex-end", alignItems: 'center', backgroundColor: "white" }}>
|
<View style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor: "white"
|
||||||
|
}}>
|
||||||
<Text style={markerDetails.title}>{name}</Text>
|
<Text style={markerDetails.title}>{name}</Text>
|
||||||
<Icon.Button name={"close"} size={24} color={"red"} backgroundColor={"transparent"}
|
<Icon.Button name={"close"} size={24} color={"red"} backgroundColor={"transparent"}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
|
@ -972,6 +1023,7 @@ class Home extends BaseScreen {
|
||||||
</CardView>);
|
</CardView>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderCurrentMarker(marker) {
|
renderCurrentMarker(marker) {
|
||||||
if (marker) {
|
if (marker) {
|
||||||
return (<View>
|
return (<View>
|
||||||
|
|
@ -1068,7 +1120,8 @@ class Home extends BaseScreen {
|
||||||
>
|
>
|
||||||
<Icon name="group-work" style={styles.actionButtonIcon}/>
|
<Icon name="group-work" style={styles.actionButtonIcon}/>
|
||||||
</ActionButton.Item>
|
</ActionButton.Item>
|
||||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")} onPress={() => this.refocusMap(false)}
|
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")}
|
||||||
|
onPress={() => this.refocusMap(false)}
|
||||||
size={48}
|
size={48}
|
||||||
>
|
>
|
||||||
<Icon name="person-pin" style={styles.actionButtonIcon}/>
|
<Icon name="person-pin" style={styles.actionButtonIcon}/>
|
||||||
|
|
@ -1181,7 +1234,9 @@ class Home extends BaseScreen {
|
||||||
</View>
|
</View>
|
||||||
</Animated.View>)*/
|
</Animated.View>)*/
|
||||||
return (<BottomSheet
|
return (<BottomSheet
|
||||||
ref={(r) => { this.bottomSheetRef = r }}
|
ref={(r) => {
|
||||||
|
this.bottomSheetRef = r
|
||||||
|
}}
|
||||||
snapPoints={[0, "30%"]}
|
snapPoints={[0, "30%"]}
|
||||||
renderHeader={() => this.markerView()}
|
renderHeader={() => this.markerView()}
|
||||||
/>)
|
/>)
|
||||||
|
|
@ -1262,11 +1317,13 @@ class Home extends BaseScreen {
|
||||||
isSaveOneSignalOK: false
|
isSaveOneSignalOK: false
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
onMarkerPress(marker) {
|
onMarkerPress(marker) {
|
||||||
console.warn(marker)
|
console.warn(marker)
|
||||||
this.setState({currentMarker: marker});
|
this.setState({currentMarker: marker});
|
||||||
this.toggleSlidingUp(true)
|
this.toggleSlidingUp(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMapTypeChange() {
|
onMapTypeChange() {
|
||||||
var newState = {index: this.state.indexTypeMap, text: this.state.typeMap};
|
var newState = {index: this.state.indexTypeMap, text: this.state.typeMap};
|
||||||
newState.index = newState.index + 1;
|
newState.index = newState.index + 1;
|
||||||
|
|
@ -1285,6 +1342,7 @@ class Home extends BaseScreen {
|
||||||
}
|
}
|
||||||
this.setState({indexTypeMap: newState.index, typeMap: newState.text});
|
this.setState({indexTypeMap: newState.index, typeMap: newState.text});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
<IMap style={{...StyleSheet.absoluteFillObject,backgroundColor:'red'}}
|
<IMap style={{...StyleSheet.absoluteFillObject,backgroundColor:'red'}}
|
||||||
ref={(re)=>{
|
ref={(re)=>{
|
||||||
|
|
@ -1335,6 +1393,7 @@ class Home extends BaseScreen {
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBottomHome() {
|
renderBottomHome() {
|
||||||
return (
|
return (
|
||||||
<View style={{flex: 1, backgroundColor: "lightblue"}}>
|
<View style={{flex: 1, backgroundColor: "lightblue"}}>
|
||||||
|
|
@ -1388,29 +1447,45 @@ class Home extends BaseScreen {
|
||||||
}}
|
}}
|
||||||
onNeedRoadError={(message) => {
|
onNeedRoadError={(message) => {
|
||||||
this.setState({showProgress: false})
|
this.setState({showProgress: false})
|
||||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{
|
||||||
|
text: "Ok",
|
||||||
|
onPress: () => {
|
||||||
|
}
|
||||||
|
}])
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{this.makeCardSearch()}
|
{this.makeCardSearch()}
|
||||||
<BottomSheet
|
<BottomSheet
|
||||||
ref={(r) => { this.bottomSheetRef = r }}
|
ref={(r) => {
|
||||||
|
this.bottomSheetRef = r
|
||||||
|
}}
|
||||||
snapPoints={[60, "30%", "100%"]}
|
snapPoints={[60, "30%", "100%"]}
|
||||||
renderHeader={() => this.renderHeader()}
|
renderHeader={() => this.renderHeader()}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderInner() {
|
renderInner() {
|
||||||
return (<View style={{flex: 1, backgroundColor: "green"}}>
|
return (<View style={{flex: 1, backgroundColor: "green"}}>
|
||||||
<Text>Freud junior</Text>
|
<Text>Freud junior</Text>
|
||||||
</View>)
|
</View>)
|
||||||
}
|
}
|
||||||
|
|
||||||
markerView() {
|
markerView() {
|
||||||
if (this.state.currentMarker) return this._renderMarker2()
|
if (this.state.currentMarker) return this._renderMarker2()
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHeader() {
|
renderHeader() {
|
||||||
return (<React.Fragment>
|
return (<React.Fragment>
|
||||||
<View style={{ position: "absolute", width: 32, height: this.state.currentMarker ? 200 : 100, bottom: 80, right: 0, justifyContent: 'center' }}>
|
<View style={{
|
||||||
|
position: "absolute",
|
||||||
|
width: 32,
|
||||||
|
height: this.state.currentMarker ? 200 : 100,
|
||||||
|
bottom: 80,
|
||||||
|
right: 0,
|
||||||
|
justifyContent: 'center'
|
||||||
|
}}>
|
||||||
<ActionButton size={32} style={{marginRight: 15}} buttonColor="white"/>
|
<ActionButton size={32} style={{marginRight: 15}} buttonColor="white"/>
|
||||||
<ActionButton size={42}
|
<ActionButton size={42}
|
||||||
renderIcon={() => {
|
renderIcon={() => {
|
||||||
|
|
@ -1424,8 +1499,15 @@ class Home extends BaseScreen {
|
||||||
{this.markerView()}
|
{this.markerView()}
|
||||||
{this.renderFilterMarker()}
|
{this.renderFilterMarker()}
|
||||||
|
|
||||||
<View style={{ flexDirection: 'row', height: 60, justifyContent: 'space-evenly', alignItems: 'flex-end' }}>
|
<View
|
||||||
<View style={{ flexDirection: 'row', flex: 1, marginBottom: 10, justifyContent: 'space-around', alignItems: 'flex-end' }}>
|
style={{flexDirection: 'row', height: 60, justifyContent: 'space-evenly', alignItems: 'flex-end'}}>
|
||||||
|
<View style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
flex: 1,
|
||||||
|
marginBottom: 10,
|
||||||
|
justifyContent: 'space-around',
|
||||||
|
alignItems: 'flex-end'
|
||||||
|
}}>
|
||||||
<FAB small
|
<FAB small
|
||||||
icon={!this.state.showFilterDistance ? "filter" : "close"}
|
icon={!this.state.showFilterDistance ? "filter" : "close"}
|
||||||
color={theme.primary}
|
color={theme.primary}
|
||||||
|
|
@ -1462,7 +1544,8 @@ class Home extends BaseScreen {
|
||||||
|
|
||||||
renderFilterMarker() {
|
renderFilterMarker() {
|
||||||
if (this.state.showFilterDistance)
|
if (this.state.showFilterDistance)
|
||||||
return (<View style={{ height: responsiveHeight(80), justifyContent: 'center', backgroundColor: 'white', margin: 20 }}>
|
return (<View
|
||||||
|
style={{height: responsiveHeight(80), justifyContent: 'center', backgroundColor: 'white', margin: 20}}>
|
||||||
<View style={{height: responsiveHeight(30), justifyContent: 'center'}}>
|
<View style={{height: responsiveHeight(30), justifyContent: 'center'}}>
|
||||||
<Text>{I18n.t('TEXT_FILTER_DISTANCE')} </Text>
|
<Text>{I18n.t('TEXT_FILTER_DISTANCE')} </Text>
|
||||||
<SnapSlider
|
<SnapSlider
|
||||||
|
|
@ -1485,6 +1568,7 @@ class Home extends BaseScreen {
|
||||||
</View>
|
</View>
|
||||||
</View>)
|
</View>)
|
||||||
}
|
}
|
||||||
|
|
||||||
makeMarkerButton() {
|
makeMarkerButton() {
|
||||||
if (this.state.currentMarker) {
|
if (this.state.currentMarker) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -1513,8 +1597,7 @@ class Home extends BaseScreen {
|
||||||
>{I18n.t("CALL")}</Text></View>
|
>{I18n.t("CALL")}</Text></View>
|
||||||
</Button>
|
</Button>
|
||||||
</View>)
|
</View>)
|
||||||
}
|
} else return (<View style={{flex: 2, flexDirection: 'row', justifyContent: 'flex-end', marginEnd: 20}}>
|
||||||
else return (<View style={{ flex: 2, flexDirection: 'row', justifyContent: 'flex-end', marginEnd: 20 }}>
|
|
||||||
</View>)
|
</View>)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1576,10 +1659,23 @@ class Home extends BaseScreen {
|
||||||
{/* {
|
{/* {
|
||||||
(this.state.loadingDialog || this.props.loading) ?
|
(this.state.loadingDialog || this.props.loading) ?
|
||||||
<View
|
<View
|
||||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
zIndex: 1,
|
||||||
|
backgroundColor: "#00000050",
|
||||||
|
width: this.state.loadingDialog ? responsiveWidth(100) : 0,
|
||||||
|
height: this.state.loadingDialog ? responsiveHeight(100) : 0,
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center'
|
||||||
|
}}
|
||||||
|
|
||||||
>
|
>
|
||||||
<Text style={{ fontSize: 20, color: 'white', fontWeight: 'bold' }}>{I18n.t("LOADING_DOTS")}</Text>
|
<Text style={{
|
||||||
|
fontSize: 20,
|
||||||
|
color: 'white',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}}>{I18n.t("LOADING_DOTS")}</Text>
|
||||||
</View> : null
|
</View> : null
|
||||||
}
|
}
|
||||||
<IMap
|
<IMap
|
||||||
|
|
@ -1606,7 +1702,11 @@ class Home extends BaseScreen {
|
||||||
}}
|
}}
|
||||||
onNeedRoadError={(message) => {
|
onNeedRoadError={(message) => {
|
||||||
this.setState({showProgress: false})
|
this.setState({showProgress: false})
|
||||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{
|
||||||
|
text: "Ok",
|
||||||
|
onPress: () => {
|
||||||
|
}
|
||||||
|
}])
|
||||||
}}
|
}}
|
||||||
/>*/}
|
/>*/}
|
||||||
{this.makeCardSearch()}
|
{this.makeCardSearch()}
|
||||||
|
|
@ -1661,6 +1761,7 @@ class Home extends BaseScreen {
|
||||||
console.log("ERROR LOADING USER", error.message);
|
console.log("ERROR LOADING USER", error.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderTutoOldHome() {
|
renderTutoOldHome() {
|
||||||
return (<View style={{flex: 1}}>
|
return (<View style={{flex: 1}}>
|
||||||
|
|
||||||
|
|
@ -1669,12 +1770,14 @@ class Home extends BaseScreen {
|
||||||
</CopilotStep>
|
</CopilotStep>
|
||||||
</View>)
|
</View>)
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (false) {
|
if (false) {
|
||||||
return this.renderBottomHome()
|
return this.renderBottomHome()
|
||||||
} else
|
} else
|
||||||
return this.renderOldHome()
|
return this.renderOldHome()
|
||||||
}
|
}
|
||||||
|
|
||||||
renderCurrentMarker() {
|
renderCurrentMarker() {
|
||||||
if (this.state.currentMarker) {
|
if (this.state.currentMarker) {
|
||||||
return (<View style={{height: 200, backgroundColor: '#fff'}}>
|
return (<View style={{height: 200, backgroundColor: '#fff'}}>
|
||||||
|
|
@ -1682,6 +1785,7 @@ class Home extends BaseScreen {
|
||||||
</View>)
|
</View>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
makeDialogLoader() {
|
makeDialogLoader() {
|
||||||
|
|
||||||
return (<ProgressDialog
|
return (<ProgressDialog
|
||||||
|
|
@ -1698,7 +1802,13 @@ class Home extends BaseScreen {
|
||||||
const user = usr === null ? this.state.user : usr
|
const user = usr === null ? this.state.user : usr
|
||||||
let {myNetwork} = this.state;
|
let {myNetwork} = this.state;
|
||||||
|
|
||||||
this.setState({ filternetwork: myNetwork, page: 0, increasePas: 0, filternetworkTemp: myNetwork, loadingDialog: true })
|
this.setState({
|
||||||
|
filternetwork: myNetwork,
|
||||||
|
page: 0,
|
||||||
|
increasePas: 0,
|
||||||
|
filternetworkTemp: myNetwork,
|
||||||
|
loadingDialog: true
|
||||||
|
})
|
||||||
return new Promise(() => {
|
return new Promise(() => {
|
||||||
if (myNetwork !== undefined) {
|
if (myNetwork !== undefined) {
|
||||||
this.loadingMarkers(this.state.myPosition, myNetwork, this.state.value).then((data) => {
|
this.loadingMarkers(this.state.myPosition, myNetwork, this.state.value).then((data) => {
|
||||||
|
|
@ -1790,7 +1900,12 @@ class Home extends BaseScreen {
|
||||||
this.treatNewData(this.state.prevRegion, datas, true)
|
this.treatNewData(this.state.prevRegion, datas, true)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.setState({showProgress: false})
|
this.setState({showProgress: false})
|
||||||
Alert.alert(I18n.t("ERROR_FILTER"), I18n.t("ERROR_FILTER_TEXT"), [{ text: I18n.t("CANCEL") }, { text: I18n.t("RESTART"), onPress: () => { this.filterPoint() } }])
|
Alert.alert(I18n.t("ERROR_FILTER"), I18n.t("ERROR_FILTER_TEXT"), [{text: I18n.t("CANCEL")}, {
|
||||||
|
text: I18n.t("RESTART"),
|
||||||
|
onPress: () => {
|
||||||
|
this.filterPoint()
|
||||||
|
}
|
||||||
|
}])
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({showProgress: false})
|
this.setState({showProgress: false})
|
||||||
|
|
@ -1956,7 +2071,8 @@ class Home extends BaseScreen {
|
||||||
heading: 300,
|
heading: 300,
|
||||||
altitude: 10,
|
altitude: 10,
|
||||||
zoom: 15},1000)
|
zoom: 15},1000)
|
||||||
*/}
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
|
|
@ -1974,12 +2090,15 @@ class Home extends BaseScreen {
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
markerManager: MarkerManager
|
markerManager: MarkerManager
|
||||||
|
|
||||||
getHypervisorActionButton() {
|
getHypervisorActionButton() {
|
||||||
return (<ActionButton
|
return (<ActionButton
|
||||||
buttonColor={theme.accent}
|
buttonColor={theme.accent}
|
||||||
>
|
>
|
||||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")} onPress={() => this.refocusMap(false)}
|
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")}
|
||||||
|
onPress={() => this.refocusMap(false)}
|
||||||
size={48}
|
size={48}
|
||||||
>
|
>
|
||||||
<Icon name="person-pin" style={styles.actionButtonIcon}/>
|
<Icon name="person-pin" style={styles.actionButtonIcon}/>
|
||||||
|
|
@ -2094,7 +2213,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
this.setState({loadingDialog: true})
|
this.setState({loadingDialog: true})
|
||||||
|
|
@ -2121,7 +2244,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
if (this.state.allpoint.length <= 0) {
|
if (this.state.allpoint.length <= 0) {
|
||||||
|
|
@ -2179,8 +2306,18 @@ class Home extends BaseScreen {
|
||||||
if (this.state.isLoadingMap)
|
if (this.state.isLoadingMap)
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{ flexDirection: 'row', margin: 10, width: responsiveWidth(95), backgroundColor: 'white', justifyContent: "center", alignSelf: "center" }}>
|
style={{
|
||||||
<Text style={{ fontSize: 12, alignSelf: 'center' }}>{I18n.t("LOADING_TEXT_MARKERS") + " " + this.filterOptions[this.state.increasePas].value + " km " + I18n.t("DISTANCE_ARROUND")}</Text>
|
flexDirection: 'row',
|
||||||
|
margin: 10,
|
||||||
|
width: responsiveWidth(95),
|
||||||
|
backgroundColor: 'white',
|
||||||
|
justifyContent: "center",
|
||||||
|
alignSelf: "center"
|
||||||
|
}}>
|
||||||
|
<Text style={{
|
||||||
|
fontSize: 12,
|
||||||
|
alignSelf: 'center'
|
||||||
|
}}>{I18n.t("LOADING_TEXT_MARKERS") + " " + this.filterOptions[this.state.increasePas].value + " km " + I18n.t("DISTANCE_ARROUND")}</Text>
|
||||||
<ProgressBarAndroid style={{alignSelf: 'center'}}/>
|
<ProgressBarAndroid style={{alignSelf: 'center'}}/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -2205,7 +2342,11 @@ class Home extends BaseScreen {
|
||||||
return geolib.getDistance(myPosition, location) <= (value * 1000)
|
return geolib.getDistance(myPosition, location) <= (value * 1000)
|
||||||
&& mark.network === filternetwork.name
|
&& mark.network === filternetwork.name
|
||||||
})
|
})
|
||||||
this.setState({ currentNetworkSize: currentNetwork.length, showProgress: false, currentNetworkMarkers: currentNetwork })
|
this.setState({
|
||||||
|
currentNetworkSize: currentNetwork.length,
|
||||||
|
showProgress: false,
|
||||||
|
currentNetworkMarkers: currentNetwork
|
||||||
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.debug("after " + e.message)
|
console.debug("after " + e.message)
|
||||||
}
|
}
|
||||||
|
|
@ -2236,12 +2377,16 @@ class Home extends BaseScreen {
|
||||||
{ cancelable: false }
|
{ cancelable: false }
|
||||||
); */
|
); */
|
||||||
if (this.state.increasePas === this.filterOptions.length - 1) {
|
if (this.state.increasePas === this.filterOptions.length - 1) {
|
||||||
this.setState({ increasePas: 0, snack_visible: true, snack_text_message: I18n.t('NO_NETWORK_MARKER'), isLoadingMap: false })
|
this.setState({
|
||||||
|
increasePas: 0,
|
||||||
|
snack_visible: true,
|
||||||
|
snack_text_message: I18n.t('NO_NETWORK_MARKER'),
|
||||||
|
isLoadingMap: false
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.setState({snack_visible: false})
|
this.setState({snack_visible: false})
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (this.state.increasePas + 1 !== this.filterOptions.length) {
|
if (this.state.increasePas + 1 !== this.filterOptions.length) {
|
||||||
this.setState({increasePas: this.state.increasePas + 1, isLoadingMap: true}, () => {
|
this.setState({increasePas: this.state.increasePas + 1, isLoadingMap: true}, () => {
|
||||||
this.onLoadMore();
|
this.onLoadMore();
|
||||||
|
|
@ -2329,7 +2474,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
this.treatPosition(myPosition)
|
this.treatPosition(myPosition)
|
||||||
|
|
@ -2348,7 +2497,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
this.treatPosition(myPosition)
|
this.treatPosition(myPosition)
|
||||||
|
|
@ -2367,7 +2520,11 @@ class Home extends BaseScreen {
|
||||||
I18n.t('TEXT_NETWORK_UNABLE')
|
I18n.t('TEXT_NETWORK_UNABLE')
|
||||||
,
|
,
|
||||||
[
|
[
|
||||||
{ text: I18n.t("NO"), onPress: () => { BackHandler.exitApp() } },
|
{
|
||||||
|
text: I18n.t("NO"), onPress: () => {
|
||||||
|
BackHandler.exitApp()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t("YES"), onPress: () => {
|
||||||
this.treatPosition(myPosition)
|
this.treatPosition(myPosition)
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class CreateIdentificationUser extends Component {
|
||||||
townName: null,
|
townName: null,
|
||||||
country: null,
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
snackText: '',
|
snackText: '',
|
||||||
disableNetwork: false,
|
disableNetwork: false,
|
||||||
|
|
@ -531,8 +531,8 @@ class CreateIdentificationUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return 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 }}>
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
townName: null,
|
townName: null,
|
||||||
country: null,
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
snackText: '',
|
snackText: '',
|
||||||
disableNetwork: false,
|
disableNetwork: false,
|
||||||
|
|
@ -533,8 +533,8 @@ class ModifyIdentificationUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return 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 }}>
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class CreateIdentification extends Component {
|
||||||
townName: null,
|
townName: null,
|
||||||
country: null,
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
snackText: '',
|
snackText: '',
|
||||||
disableNetwork: false,
|
disableNetwork: false,
|
||||||
|
|
@ -640,8 +640,8 @@ class CreateIdentification extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return 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 }}>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class AskNanoCredit extends Component {
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
typeCaution: typeCaution(),
|
typeCaution: typeCaution(),
|
||||||
typeCautionName: (typeCaution()[0]).name,
|
typeCautionName: I18n.t((typeCaution()[0]).name),
|
||||||
typeCautionToSend: 'groupe',
|
typeCautionToSend: 'groupe',
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
};
|
};
|
||||||
|
|
@ -273,6 +273,7 @@ class AskNanoCredit extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log(this.state);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
|
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
|
||||||
|
|
@ -332,10 +333,10 @@ class AskNanoCredit extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
typeCautionToSend: 'groupe',
|
typeCautionToSend: 'groupe',
|
||||||
typeCautionName: I18n.t('GROUP')
|
typeCautionName: I18n.t('GROUP')
|
||||||
})
|
});
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,8 @@ class DemandValidationGroup extends React.Component {
|
||||||
this.props.getNanoCreditDemandsAction(user.id);
|
this.props.getNanoCreditDemandsAction(user.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
|
|
||||||
this.props.getNanoCreditDemandsReset();
|
this.props.getNanoCreditDemandsReset();
|
||||||
this.navigation = this.props.navigation
|
this.navigation = this.props.navigation
|
||||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||||
|
|
@ -107,6 +109,11 @@ class DemandValidationGroup extends React.Component {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateLangue() {
|
||||||
|
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
||||||
|
this.forceUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { routeName } = this.navigation.state
|
const { routeName } = this.navigation.state
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class EpargnerArgentUser extends Component {
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
typeEpargne: typeEpargne(),
|
typeEpargne: typeEpargne(),
|
||||||
typeEpargneName: (typeEpargne()[0]).name,
|
typeEpargneName: I18n.t((typeEpargne()[0]).name),
|
||||||
typeEpargneToSend: 'simple',
|
typeEpargneToSend: 'simple',
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
};
|
};
|
||||||
|
|
@ -314,8 +314,8 @@ class EpargnerArgentUser extends Component {
|
||||||
displayDuration: true
|
displayDuration: true
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
@ -340,8 +340,8 @@ class EpargnerArgentUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ durationSelect: value });
|
this.setState({ durationSelect: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.value }}
|
valueExtractor={(value) => { return I18n.t(value.value) }}
|
||||||
labelExtractor={(value) => { return value.value }}
|
labelExtractor={(value) => { return I18n.t(value.value) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -544,7 +544,7 @@ export default class OptionsMenu extends Component {
|
||||||
text: I18n.t('YES'), onPress: () => {
|
text: I18n.t('YES'), onPress: () => {
|
||||||
disconnect().then(() => {
|
disconnect().then(() => {
|
||||||
IlinkEmitter.emit("userdisconnect");
|
IlinkEmitter.emit("userdisconnect");
|
||||||
AsyncStorage.clear();
|
//AsyncStorage.clear();
|
||||||
this.props.navigation.navigate("Auth");
|
this.props.navigation.navigate("Auth");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,16 @@
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import { FlatList, Image, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
import {
|
||||||
import { ScrollView } from 'react-native-gesture-handler';
|
ActivityIndicator,
|
||||||
|
Image,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import {Appbar, Provider} from 'react-native-paper';
|
import {Appbar, Provider} from 'react-native-paper';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
|
@ -8,10 +18,16 @@ import { Color } from '../../config/Color';
|
||||||
import {Typography} from '../../config/typography';
|
import {Typography} from '../../config/typography';
|
||||||
import * as Utils from '../../utils/DeviceUtils';
|
import * as Utils from '../../utils/DeviceUtils';
|
||||||
import {IlinkEmitter} from "../../utils/events";
|
import {IlinkEmitter} from "../../utils/events";
|
||||||
|
import {connect} from "react-redux";
|
||||||
|
import {bindActionCreators} from "redux";
|
||||||
|
import {getBankListAction, getBankListReset} from "../../webservice/BankApi";
|
||||||
|
import {store} from "../../redux/store";
|
||||||
|
import {readUser} from "../../webservice/AuthApi";
|
||||||
|
|
||||||
const route = require('../../route.json');
|
const route = require('../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
|
||||||
export default class OperateurOptionSelect extends Component {
|
class OperateurOptionSelect extends Component {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
@ -21,7 +37,23 @@ export default class OperateurOptionSelect extends Component {
|
||||||
options: this.props.navigation.state.params.optionSelect.options,
|
options: this.props.navigation.state.params.optionSelect.options,
|
||||||
title: this.props.navigation.state.params.optionSelect.title,
|
title: this.props.navigation.state.params.optionSelect.title,
|
||||||
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
||||||
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
}
|
}
|
||||||
|
this.props.getBankListReset();
|
||||||
|
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user) {
|
||||||
|
if (user !== undefined) {
|
||||||
|
if (user.category === undefined) {
|
||||||
|
this.props.getBankListAction(this.state.wallet.id_wallet_network);
|
||||||
|
} else {
|
||||||
|
if (user.category === 'geolocated')
|
||||||
|
this.props.getBankListAction(this.state.wallet.id_network);
|
||||||
|
}
|
||||||
|
this.setState({user});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +85,92 @@ export default class OperateurOptionSelect extends Component {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderLoader = () => {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
{Platform.OS === 'android'
|
||||||
|
?
|
||||||
|
(
|
||||||
|
<>
|
||||||
|
<ProgressBarAndroid/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
|
</>
|
||||||
|
) :
|
||||||
|
<>
|
||||||
|
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||||
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
renderItem = (item, index) => {
|
renderItem = (item, index) => {
|
||||||
|
return (
|
||||||
|
|
||||||
|
<TouchableOpacity
|
||||||
|
key={index}
|
||||||
|
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
|
||||||
|
onPress={() => {
|
||||||
|
if (this.state.user.category === 'geolocated')
|
||||||
|
this.props.navigation.navigate(route.envoieWalletToBankAgent, {bank: item});
|
||||||
|
else
|
||||||
|
this.props.navigation.navigate(route.envoieWalletToBankUser, {bank: item});
|
||||||
|
}}>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'center'}}>
|
||||||
|
<View>
|
||||||
|
<Text style={Typography.body1}>{item.bank_name}</Text>
|
||||||
|
<Text style={[Typography.footnote, Color.grayColor]} style={{marginTop: 5}}>
|
||||||
|
{I18n.t('COUNTRY')}: {item.country}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
renderBankList = () => {
|
||||||
|
|
||||||
|
const {result, error} = this.props;
|
||||||
|
if (error !== null) {
|
||||||
|
if (typeof error.data !== 'undefined') {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text style={Typography.body1}>{error.data.error}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text style={Typography.body1}>{error}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (result !== null) {
|
||||||
|
if (result.response !== null) {
|
||||||
|
return (
|
||||||
|
Array.isArray(result.response) && (result.response.length) > 0 ?
|
||||||
|
(<ScrollView style={{flex: 1, padding: 20}}>
|
||||||
|
{
|
||||||
|
result.response.map((item, index) => (
|
||||||
|
this.renderItem(item, index)
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</ScrollView>) :
|
||||||
|
(
|
||||||
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_BANK_AVAILABLE')}</Text>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
renderItemElement = (item, index) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
|
@ -85,14 +202,16 @@ export default class OperateurOptionSelect extends Component {
|
||||||
<ScrollView style={{flex: 1, padding: 20}}>
|
<ScrollView style={{flex: 1, padding: 20}}>
|
||||||
{
|
{
|
||||||
options.map((item, index) => (
|
options.map((item, index) => (
|
||||||
this.renderItem(item, index)
|
this.renderItemElement(item, index)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log("OPERATEUR OPTION STATE", this.state.options.length);
|
||||||
return (
|
return (
|
||||||
<Provider>
|
<Provider>
|
||||||
<View style={{flex: 1}}>
|
<View style={{flex: 1}}>
|
||||||
|
|
@ -105,43 +224,28 @@ export default class OperateurOptionSelect extends Component {
|
||||||
|
|
||||||
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
|
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
|
||||||
<Appbar.BackAction
|
<Appbar.BackAction
|
||||||
onPress={() => { this.props.navigation.pop() }}
|
onPress={() => {
|
||||||
|
this.props.navigation.pop()
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Appbar.Content
|
<Appbar.Content
|
||||||
title={this.state.title}
|
title={I18n.t(this.state.title)}
|
||||||
subtitle={this.state.subTitle}
|
subtitle={I18n.t(this.state.subTitle)}
|
||||||
/>
|
/>
|
||||||
</Appbar.Header>
|
</Appbar.Header>
|
||||||
|
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
|
||||||
<FlatList
|
{
|
||||||
contentContainerStyle={{
|
this.state.options.length > 0 ?
|
||||||
paddingHorizontal: 20,
|
this.renderList()
|
||||||
paddingBottom: 10,
|
:
|
||||||
}}
|
this.props.loading ?
|
||||||
data={this.state.options}
|
this.renderLoader() :
|
||||||
keyExtractor={(item, index) => index.toString()}
|
this.props.result != null ?
|
||||||
renderItem={({ item, index }) => (
|
this.renderBankList() :
|
||||||
<TouchableOpacity
|
null
|
||||||
style={[styles.item, { borderBottomColor: Color.borderColor }]}
|
}
|
||||||
onPress={() => {
|
|
||||||
this.redirectToRoute(item);
|
|
||||||
}}>
|
|
||||||
<View style={{ flexDirection: 'row' }}>
|
|
||||||
<Image style={{ width: 30, height: 30 }} source={{ uri: item.icon }} />
|
|
||||||
|
|
||||||
<Text style={[Typography.body1]}>{item.title}</Text>
|
|
||||||
</View>
|
|
||||||
<Icon
|
|
||||||
name="chevron-right"
|
|
||||||
size={20}
|
|
||||||
color={Color.primaryColor}
|
|
||||||
enableRTL={true}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -151,6 +255,18 @@ export default class OperateurOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const mapStateToProps = state => ({
|
||||||
|
loading: state.getBankListReducer.loading,
|
||||||
|
result: state.getBankListReducer.result,
|
||||||
|
error: state.getBankListReducer.error,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
getBankListAction,
|
||||||
|
getBankListReset
|
||||||
|
}, dispatch);
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(OperateurOptionSelect);
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ class WalletDepot extends Component {
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => value.value}
|
valueExtractor={(value) => value.value}
|
||||||
labelExtractor={(value) => value.name}
|
labelExtractor={(value) => I18n.t(value.name)}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
||||||
|
|
||||||
<Dialog.Title>Détail de l'historique</Dialog.Title>
|
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
|
||||||
|
|
||||||
<View>
|
<View>
|
||||||
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
|
@ -659,7 +659,7 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displaySuperHyperModalHistory}>
|
<Dialog.Container useNativeDriver={true} visible={this.state.displaySuperHyperModalHistory}>
|
||||||
|
|
||||||
<Dialog.Title>Détail de l'historique</Dialog.Title>
|
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
|
||||||
|
|
||||||
{isEqual(historyItemDetail.type_historique, 'N') &&
|
{isEqual(historyItemDetail.type_historique, 'N') &&
|
||||||
<ScrollView persistentScrollbar={true}>
|
<ScrollView persistentScrollbar={true}>
|
||||||
|
|
@ -669,7 +669,7 @@ class WalletDetail extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -1022,7 +1022,7 @@ class WalletDetail extends Component {
|
||||||
<View style={{ alignItems: 'center' }} key={index}>
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
@ -1489,7 +1489,7 @@ class WalletDetail extends Component {
|
||||||
<View style={{ alignItems: 'center' }} key={index}>
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,37 @@
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import { Animated, Alert, Platform, StyleSheet, View, Image, StatusBar, ScrollView, Text, ProgressBarAndroid, ActivityIndicator, TouchableOpacity } from 'react-native';
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Animated,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
import { TabView, TabBar, SceneMap } from 'react-native-tab-view';
|
|
||||||
import * as Utils from '../../utils/DeviceUtils';
|
import * as Utils from '../../utils/DeviceUtils';
|
||||||
import Icons from 'react-native-vector-icons/Ionicons'
|
import Icons from 'react-native-vector-icons/Ionicons'
|
||||||
import { Images } from '../../config/Images';
|
|
||||||
import CustomButton from '../../components/CustomButton';
|
|
||||||
import {Color} from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import omit from 'lodash/omit';
|
import omit from 'lodash/omit';
|
||||||
import Tag from '../../components/Tag';
|
import Tag from '../../components/Tag';
|
||||||
import {IlinkEmitter} from "../../utils/events";
|
import {IlinkEmitter} from "../../utils/events";
|
||||||
import { CreditCardInput } from "react-native-credit-card-input";
|
import {Typography} from '../../config/typography';
|
||||||
import { Typography, FontWeight } from '../../config/typography';
|
import {responsiveWidth,} from 'react-native-responsive-dimensions';
|
||||||
import { responsiveHeight, responsiveWidth, } from 'react-native-responsive-dimensions';
|
|
||||||
import {getWalletDetailActivated, resetWalletListDetailReducer} from '../../webservice/WalletApi';
|
import {getWalletDetailActivated, resetWalletListDetailReducer} from '../../webservice/WalletApi';
|
||||||
import {depositActionReset} from '../../webservice/DepositApi';
|
import {depositActionReset} from '../../webservice/DepositApi';
|
||||||
import { getWalletTransactionHistoryUser, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
|
import {
|
||||||
|
getWalletTransactionHistoryReset,
|
||||||
|
getWalletTransactionHistoryUser
|
||||||
|
} from '../../webservice/WalletTransactionHistoryApi';
|
||||||
import {getUserIdentificationAction, getUserIdentificationResetAction} from '../../webservice/IdentificationApi';
|
import {getUserIdentificationAction, getUserIdentificationResetAction} from '../../webservice/IdentificationApi';
|
||||||
import { transferCommissionAction } from '../../webservice/WalletTransferCommission';
|
import {resetCommissionReducer, transferCommissionAction} from '../../webservice/WalletTransferCommission';
|
||||||
import { resetCommissionReducer } from '../../webservice/WalletTransferCommission';
|
|
||||||
import Dialog from "react-native-dialog";
|
import Dialog from "react-native-dialog";
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import {baseUrl} from '../../webservice/IlinkConstants';
|
import {baseUrl} from '../../webservice/IlinkConstants';
|
||||||
let moment = require('moment-timezone');
|
|
||||||
import 'moment/locale/fr'
|
import 'moment/locale/fr'
|
||||||
import 'moment/locale/es-us'
|
import 'moment/locale/es-us'
|
||||||
import 'moment/locale/en-au'
|
import 'moment/locale/en-au'
|
||||||
|
|
@ -34,9 +42,22 @@ import 'moment/locale/en-nz'
|
||||||
import 'moment/locale/en-gb'
|
import 'moment/locale/en-gb'
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {bindActionCreators} from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionRetraitUserScreen, transactionHistoryLabel, optionPaiementFacture, displayToast, transactionHistoryIlinkLabel, isIlinkWorldWallet, cutStringWithoutDot, cutString, optionIdentificationUserScreen, optionNanoCreditScreen } from '../../utils/UtilsFunction';
|
import {
|
||||||
|
cutString,
|
||||||
|
cutStringWithoutDot,
|
||||||
|
isEmptyObject,
|
||||||
|
optionDepotUserScreen,
|
||||||
|
optionIdentificationUserScreen,
|
||||||
|
optionNanoCreditScreen,
|
||||||
|
optionPaiementFacture,
|
||||||
|
optionRetraitUserScreen,
|
||||||
|
transactionHistoryIlinkLabel
|
||||||
|
} from '../../utils/UtilsFunction';
|
||||||
import DeviceInfo from 'react-native-device-info';
|
import DeviceInfo from 'react-native-device-info';
|
||||||
import {readUser} from '../../webservice/AuthApi';
|
import {readUser} from '../../webservice/AuthApi';
|
||||||
|
|
||||||
|
let moment = require('moment-timezone');
|
||||||
|
|
||||||
const thousands = require('thousands');
|
const thousands = require('thousands');
|
||||||
|
|
||||||
let route = require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
|
|
@ -252,7 +273,14 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>{wallet.network}</Text>
|
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>{wallet.network}</Text>
|
||||||
<View style={{flexDirection: 'row'}}>
|
<View style={{flexDirection: 'row'}}>
|
||||||
<Tag icon={<Icon name='link' size={20} color={Color.whiteColor} style={{marginLeft: -15}}/>}
|
<Tag icon={<Icon name='link' size={20} color={Color.whiteColor} style={{marginLeft: -15}}/>}
|
||||||
style={{ paddingRight: 10, width: 120, borderTopRightRadius: 0, borderBottomRightRadius: 0, borderRightWidth: 1, borderRightColor: Color.whiteColor }}
|
style={{
|
||||||
|
paddingRight: 10,
|
||||||
|
width: 120,
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
borderBottomRightRadius: 0,
|
||||||
|
borderRightWidth: 1,
|
||||||
|
borderRightColor: Color.whiteColor
|
||||||
|
}}
|
||||||
primary
|
primary
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
this.props.navigation.push(route.linkCard);
|
this.props.navigation.push(route.linkCard);
|
||||||
|
|
@ -268,8 +296,10 @@ class WalletDetailUser extends Component {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.contentLeftItem}>
|
<View style={styles.contentLeftItem}>
|
||||||
<Text numberOfLines={1} style={[Typography.caption2, Typography.semibold]} >{I18n.t('CREATION_DATE')}</Text>
|
<Text numberOfLines={1}
|
||||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>{moment(wallet.created_date).format('DD/MM/YYYY')}</Text>
|
style={[Typography.caption2, Typography.semibold]}>{I18n.t('CREATION_DATE')}</Text>
|
||||||
|
<Text numberOfLines={1} adjustsFontSizeToFit={true}
|
||||||
|
style={Typography.caption1}>{moment(wallet.created_date).format('DD/MM/YYYY')}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
@ -316,7 +346,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={[Typography.title3, Color.primaryColor], {marginBottom: 3}}>
|
<Text style={[Typography.title3, Color.primaryColor], {marginBottom: 3}}>
|
||||||
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
|
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={[Typography.body2]}>{`${thousands(wallet.balance, ' ')} ${wallet.currency_code}`}</Text>
|
<Text
|
||||||
|
style={[Typography.body2]}>{`${thousands(wallet.balance, ' ')} ${wallet.currency_code}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -378,7 +409,11 @@ class WalletDetailUser extends Component {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}>
|
{
|
||||||
|
listener: (event) => {
|
||||||
|
this.setState({scrollHeaderY: event.nativeEvent.contentOffset.y});
|
||||||
|
}
|
||||||
|
})}>
|
||||||
<View style={{marginTop: 80,}}>
|
<View style={{marginTop: 80,}}>
|
||||||
|
|
||||||
{this.renderHeader(wallet)}
|
{this.renderHeader(wallet)}
|
||||||
|
|
@ -504,7 +539,8 @@ class WalletDetailUser extends Component {
|
||||||
<View style={[styles.content]}>
|
<View style={[styles.content]}>
|
||||||
|
|
||||||
<View style={{paddingTop: 20,}}>
|
<View style={{paddingTop: 20,}}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]}>
|
<Text
|
||||||
|
style={[Typography.headline, Typography.semibold]}>
|
||||||
{I18n.t('NANO_CREDIT')}
|
{I18n.t('NANO_CREDIT')}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -567,7 +603,9 @@ class WalletDetailUser extends Component {
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={{flex: 1}}>
|
<View style={{flex: 1}}>
|
||||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
<Text
|
||||||
|
style={[Typography.overline, Color.grayColor], {paddingVertical: 5}}
|
||||||
|
numberOfLines={5}>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -610,7 +648,9 @@ class WalletDetailUser extends Component {
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={{flex: 1}}>
|
<View style={{flex: 1}}>
|
||||||
<Text style={[Typography.overline, Color.grayColor], { paddingVertical: 5 }} numberOfLines={5}>
|
<Text
|
||||||
|
style={[Typography.overline, Color.grayColor], {paddingVertical: 5}}
|
||||||
|
numberOfLines={5}>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -644,7 +684,7 @@ class WalletDetailUser extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
||||||
|
|
||||||
<Dialog.Title>Détail de l'historique</Dialog.Title>
|
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
|
||||||
|
|
||||||
<View>
|
<View>
|
||||||
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||||
|
|
@ -653,7 +693,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={[styles.body2]}>{I18n.t('OPERATION')}</Text>
|
<Text style={[styles.body2]}>{I18n.t('OPERATION')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.operation}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.operation}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -661,7 +702,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={[styles.body2]}>{I18n.t('TRANSACTION_ID')}</Text>
|
<Text style={[styles.body2]}>{I18n.t('TRANSACTION_ID')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_transaction}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_transaction}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -669,7 +711,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={[styles.body2]}>Date</Text>
|
<Text style={[styles.body2]}>Date</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -677,7 +720,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('INIT_COUNTRY')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('INIT_COUNTRY')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.init_country}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.init_country}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -685,7 +729,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
|
<Text tyle={[Typography.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]}>{this.state.historyItemDetail.montant}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -693,7 +738,8 @@ class WalletDetailUser extends Component {
|
||||||
<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]}>{this.state.historyItemDetail.frais}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.frais}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -701,7 +747,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('NET_AMOUNT')}</Text>
|
<Text tyle={[Typography.body2]}>{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]}>{this.state.historyItemDetail.montant_net_init}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_net_init}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -709,7 +756,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('EMETTEUR')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('EMETTEUR')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.emetteur}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.emetteur}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -717,7 +765,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('DESTINATAIRE')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('DESTINATAIRE')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.destinataire}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.destinataire}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -725,7 +774,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('FINAL_COUNTRY')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('FINAL_COUNTRY')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.final_country}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.final_country}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -733,7 +783,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('NET_AMOUNT')}</Text>
|
<Text tyle={[Typography.body2]}>{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]}>{this.state.historyItemDetail.montant_net_final}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_net_final}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
|
@ -741,7 +792,8 @@ class WalletDetailUser extends Component {
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('ACTIVE_WALLET')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('ACTIVE_WALLET')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.reseau_payeur}</Text>
|
<Text
|
||||||
|
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.reseau_payeur}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -763,7 +815,9 @@ class WalletDetailUser extends Component {
|
||||||
renderHistoryTransactionItem = (item, index, wallet) => {
|
renderHistoryTransactionItem = (item, index, wallet) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={() => { this.setState({ displayModalHistory: true, historyItemDetail: item }) }} style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
<TouchableOpacity onPress={() => {
|
||||||
|
this.setState({displayModalHistory: true, historyItemDetail: item})
|
||||||
|
}} style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
|
||||||
{
|
{
|
||||||
Object.keys(omit(item, ['id', 'id_transaction', 'type', 'frais', 'init_country', 'final_country', 'source', 'emetteur', 'montant_net_final', 'montant_net_init', 'reseau_payeur', 'operation'])).map((element, i) => (
|
Object.keys(omit(item, ['id', 'id_transaction', 'type', 'frais', 'init_country', 'final_country', 'source', 'emetteur', 'montant_net_final', 'montant_net_init', 'reseau_payeur', 'operation'])).map((element, i) => (
|
||||||
<View style={{alignItems: 'center'}} key={i}>
|
<View style={{alignItems: 'center'}} key={i}>
|
||||||
|
|
@ -812,8 +866,7 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={Typography.body1}>{errorTransaction.data.error}</Text>
|
<Text style={Typography.body1}>{errorTransaction.data.error}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return (
|
return (
|
||||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
<Text style={Typography.body1}>{errorTransaction}</Text>
|
<Text style={Typography.body1}>{errorTransaction}</Text>
|
||||||
|
|
@ -834,7 +887,7 @@ class WalletDetailUser extends Component {
|
||||||
<View style={{alignItems: 'center'}} key={index}>
|
<View style={{alignItems: 'center'}} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor}/>
|
<Icon name={item.icon} size={24} color={Color.primaryColor}/>
|
||||||
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
|
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
@ -987,10 +1040,6 @@ const styles = StyleSheet.create({
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
blockView: {
|
|
||||||
paddingVertical: 10,
|
|
||||||
borderBottomWidth: 0.5,
|
|
||||||
},
|
|
||||||
containField: {
|
containField: {
|
||||||
padding: 10,
|
padding: 10,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ class WalletOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
this.props.navigation.setParams({ name: I18n.t('WALLET') });
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,7 +221,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<View style={styles.contentTitle}>
|
<View style={styles.contentTitle}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]}>
|
<Text style={[Typography.headline, Typography.semibold]}>
|
||||||
{options.title}
|
{I18n.t(options.title)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -267,7 +267,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<View style={styles.contentTitle}>
|
<View style={styles.contentTitle}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]}>
|
<Text style={[Typography.headline, Typography.semibold]}>
|
||||||
{options.title}
|
{I18n.t(options.title)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -388,7 +388,7 @@ class WalletOptionSelect extends Component {
|
||||||
<View style={{ alignItems: 'center' }} key={index}>
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
@ -459,7 +459,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
||||||
|
|
||||||
<Dialog.Title>Détail de l'historique</Dialog.Title>
|
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
|
||||||
{
|
{
|
||||||
isNil(this.state.user.category) ?
|
isNil(this.state.user.category) ?
|
||||||
isEqual(historyItemDetail.type_historique, 'N') ?
|
isEqual(historyItemDetail.type_historique, 'N') ?
|
||||||
|
|
@ -470,7 +470,7 @@ class WalletOptionSelect extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -586,7 +586,7 @@ class WalletOptionSelect extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -678,7 +678,7 @@ class WalletOptionSelect extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -853,8 +853,8 @@ class WalletOptionSelect extends Component {
|
||||||
onPress={() => { this.props.navigation.pop() }}
|
onPress={() => { this.props.navigation.pop() }}
|
||||||
/>
|
/>
|
||||||
<Appbar.Content
|
<Appbar.Content
|
||||||
title={this.state.title}
|
title={I18n.t(this.state.title)}
|
||||||
subtitle={this.state.subTitle}
|
subtitle={I18n.t(this.state.subTitle)}
|
||||||
/>
|
/>
|
||||||
</Appbar.Header>
|
</Appbar.Header>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,30 @@
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import { StyleSheet, View, Image, StatusBar, Alert, ScrollView, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Image,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
const route = require('./../../route.json');
|
|
||||||
let slugify = require('slugify');
|
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
import * as Utils from '../../utils/DeviceUtils';
|
|
||||||
import { Images } from '../../config/Images';
|
|
||||||
import {Color} from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import {baseUrl} from '../../webservice/IlinkConstants';
|
import {baseUrl} from '../../webservice/IlinkConstants';
|
||||||
import {IlinkEmitter} from "../../utils/events";
|
import {IlinkEmitter} from "../../utils/events";
|
||||||
import { Provider, Appbar } from 'react-native-paper';
|
import {Appbar, Provider} from 'react-native-paper';
|
||||||
import {getWalletActivated} from '../../webservice/WalletApi';
|
import {getWalletActivated} from '../../webservice/WalletApi';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {readUser} from '../../webservice/AuthApi';
|
import {readUser} from '../../webservice/AuthApi';
|
||||||
import {bindActionCreators} from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import { FontWeight, Typography } from '../../config/typography';
|
import {Typography} from '../../config/typography';
|
||||||
|
|
||||||
|
const route = require('./../../route.json');
|
||||||
|
let slugify = require('slugify');
|
||||||
|
|
||||||
class WalletSelect extends Component {
|
class WalletSelect extends Component {
|
||||||
|
|
||||||
|
|
@ -137,8 +147,7 @@ class WalletSelect extends Component {
|
||||||
<Text style={Typography.body1}>{error.data.error}</Text>
|
<Text style={Typography.body1}>{error.data.error}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return (
|
return (
|
||||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
<Text style={Typography.body1}>{error}</Text>
|
<Text style={Typography.body1}>{error}</Text>
|
||||||
|
|
@ -182,7 +191,9 @@ class WalletSelect extends Component {
|
||||||
|
|
||||||
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
|
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
|
||||||
<Appbar.BackAction
|
<Appbar.BackAction
|
||||||
onPress={() => { this.props.navigation.pop() }}
|
onPress={() => {
|
||||||
|
this.props.navigation.pop()
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Appbar.Content
|
<Appbar.Content
|
||||||
title={I18n.t('WALLET')}
|
title={I18n.t('WALLET')}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPiecesEmetteur: identityPieces(),
|
identityPiecesEmetteur: identityPieces(),
|
||||||
identityPiecesNameEmetteur: (identityPieces()[0]).name,
|
identityPiecesNameEmetteur: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -559,8 +559,8 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
|
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,26 @@ 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, getOtherPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi';
|
import {
|
||||||
import { envoieUserWalletToCashAction, envoieUserWalletToCashReset, getCommissionUserWalletToCashAction, getCommissionUserWalletToCashReset } from '../../../webservice/EnvoieUserApi';
|
getActiveCountryAction,
|
||||||
import { Typography, FontWeight } from '../../../config/typography';
|
getActiveCountryByDialCodeAction,
|
||||||
|
getActiveCountryByDialCodeReset,
|
||||||
|
getActiveCountryReset,
|
||||||
|
getOtherPayCountryNetworkAction,
|
||||||
|
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');
|
||||||
|
|
||||||
|
|
@ -56,7 +69,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPiecesEmetteur: identityPieces(),
|
identityPiecesEmetteur: identityPieces(),
|
||||||
identityPiecesNameEmetteur: (identityPieces()[0]).name,
|
identityPiecesNameEmetteur: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -73,7 +86,6 @@ class EnvoieCashVersAutreWalletAgent 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,
|
||||||
|
|
@ -132,7 +144,10 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
paysDestinationSelect: resultActiveCountryList.response[0].name,
|
paysDestinationSelect: resultActiveCountryList.response[0].name,
|
||||||
});
|
});
|
||||||
if (this.state.hasLoadActivePayCountryNetworkList)
|
if (this.state.hasLoadActivePayCountryNetworkList)
|
||||||
this.props.getOtherPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: resultActiveCountryList.response[0].id });
|
this.props.getOtherPayCountryNetworkAction({
|
||||||
|
id_wallet_agent: this.state.wallet.id,
|
||||||
|
id_country: resultActiveCountryList.response[0].id
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,8 +195,7 @@ class EnvoieCashVersAutreWalletAgent 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: '',
|
||||||
|
|
@ -342,7 +356,8 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
<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}}>
|
||||||
|
|
@ -350,7 +365,8 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
<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>
|
||||||
|
|
@ -361,7 +377,8 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
<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>
|
||||||
|
|
@ -445,8 +462,7 @@ class EnvoieCashVersAutreWalletAgent 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 {
|
||||||
|
|
||||||
|
|
@ -497,7 +513,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
|
|
||||||
<Text style={styles.subbigtitle}>{I18n.t('DEPOSIT_CASH_TO_OTHER_WALLET_DESCRIPTION')}</Text>
|
<Text style={styles.subbigtitle}>{I18n.t('DEPOSIT_CASH_TO_OTHER_WALLET_DESCRIPTION')}</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'}
|
||||||
|
|
@ -511,7 +529,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
</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'}
|
||||||
|
|
@ -525,7 +545,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
</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'}
|
||||||
|
|
@ -540,7 +562,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
</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,
|
||||||
|
|
@ -559,12 +583,18 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false});
|
this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false});
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => {
|
||||||
labelExtractor={(value) => { return value.name }}
|
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'}
|
||||||
|
|
@ -580,14 +610,18 @@ class EnvoieCashVersAutreWalletAgent 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'}
|
||||||
|
|
@ -601,7 +635,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
</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'}
|
||||||
|
|
@ -615,7 +651,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
</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('ID_DESTINATAIRE')}`}
|
label={`${I18n.t('ID_DESTINATAIRE')}`}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
|
|
@ -629,7 +667,9 @@ class EnvoieCashVersAutreWalletAgent extends Component {
|
||||||
</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 EnvoieCashVersAutreWalletAgent 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.getOtherPayCountryNetworkAction({ id_wallet_agent: this.state.wallet.id, id_country: countrySelect[0].id });
|
paysDestinationSelect: value,
|
||||||
|
hasLoadActivePayCountryNetworkList: true,
|
||||||
|
isDataSubmit: false
|
||||||
|
}, () => {
|
||||||
|
this.props.getOtherPayCountryNetworkAction({
|
||||||
|
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 EnvoieCashVersAutreWalletAgent 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'}
|
||||||
|
|
@ -717,11 +776,14 @@ class EnvoieCashVersAutreWalletAgent 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'}
|
||||||
|
|
@ -738,7 +800,9 @@ class EnvoieCashVersAutreWalletAgent 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>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,470 @@
|
||||||
|
import Button from 'apsl-react-native-button';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
|
import isNil from 'lodash/isNil';
|
||||||
|
import React, {Component} from 'react';
|
||||||
|
import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
|
||||||
|
import * as Animatable from 'react-native-animatable';
|
||||||
|
import I18n from 'react-native-i18n';
|
||||||
|
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
|
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||||
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||||
|
import {Fumi} from 'react-native-textinput-effects';
|
||||||
|
import {connect} from 'react-redux';
|
||||||
|
import {bindActionCreators} from 'redux';
|
||||||
|
import {Color} from '../../../config/Color';
|
||||||
|
import {FontWeight, Typography} from '../../../config/typography';
|
||||||
|
import {store} from "../../../redux/store";
|
||||||
|
import {IlinkEmitter} from '../../../utils/events';
|
||||||
|
import {readUser} from '../../../webservice/AuthApi';
|
||||||
|
import {envoieUserWalletToBankAction, envoieUserWalletToBankReset} from '../../../webservice/EnvoieUserApi';
|
||||||
|
import {isNormalInteger} from '../../../utils/UtilsFunction';
|
||||||
|
|
||||||
|
let theme = require('../../../utils/theme.json');
|
||||||
|
let route = require('../../../route.json');
|
||||||
|
|
||||||
|
|
||||||
|
class EnvoieWalletToBankAgent extends Component {
|
||||||
|
|
||||||
|
static navigatorStyle = {
|
||||||
|
navBarBackgroundColor: Color.primaryColor,
|
||||||
|
statusBarColor: Color.primaryDarkColor,
|
||||||
|
navBarTextColor: '#FFFFFF',
|
||||||
|
navBarButtonColor: '#FFFFFF'
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
static navigationOptions = () => {
|
||||||
|
return {
|
||||||
|
drawerLabel: () => null,
|
||||||
|
headerTitle: I18n.t('DEPOSIT_WALLET_TO_BANK'),
|
||||||
|
headerTintColor: 'white',
|
||||||
|
headerStyle: {
|
||||||
|
backgroundColor: Color.primaryColor,
|
||||||
|
marginTop: 0,
|
||||||
|
color: 'white'
|
||||||
|
},
|
||||||
|
headerTitleStyle: {
|
||||||
|
color: "white"
|
||||||
|
},
|
||||||
|
title: I18n.t('DEPOSIT_WALLET_TO_BANK')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
montant: null,
|
||||||
|
password: null,
|
||||||
|
codeIban: null,
|
||||||
|
loading: false,
|
||||||
|
user: null,
|
||||||
|
triggerSubmitClick: false,
|
||||||
|
isSubmitClick: false,
|
||||||
|
isDataSubmit: false,
|
||||||
|
isModalConfirmVisible: false,
|
||||||
|
wallet: store.getState().walletDetailReducer.result.response,
|
||||||
|
bank: this.props.navigation.state.params.bank
|
||||||
|
};
|
||||||
|
|
||||||
|
this.props.envoieUserWalletToBankReset();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user) {
|
||||||
|
if (user !== undefined) {
|
||||||
|
this.setState({user});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
|
||||||
|
console.log('PROPS', nextProps)
|
||||||
|
|
||||||
|
/* if (nextProps.resultEnvoieWalletToCardGetCommission != null) {
|
||||||
|
|
||||||
|
if (typeof nextProps.resultEnvoieWalletToCardGetCommission.response !== 'undefined') {
|
||||||
|
|
||||||
|
if (!nextProps.loadingEnvoieWalletToCardGetCommission)
|
||||||
|
this.setState({
|
||||||
|
isModalConfirmVisible: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
renderEnvoieWalletToBankResponse = () => {
|
||||||
|
|
||||||
|
const {resultEnvoieWalletToBank, errorEnvoieWalletToBank} = this.props;
|
||||||
|
|
||||||
|
if (errorEnvoieWalletToBank !== null) {
|
||||||
|
if (typeof errorEnvoieWalletToBank.data !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_TRANSFER"),
|
||||||
|
errorEnvoieWalletToBank.data.error,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.envoieUserWalletToBankReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resultEnvoieWalletToBank !== null) {
|
||||||
|
if (resultEnvoieWalletToBank.response !== null) {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("SUCCESS_TRANSFER"),
|
||||||
|
resultEnvoieWalletToBank.response,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.envoieUserWalletToBankReset();
|
||||||
|
IlinkEmitter.emit("refreshWallet");
|
||||||
|
this.props.navigation.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
{cancelable: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* renderDialogGetCommissionResponse = () => {
|
||||||
|
|
||||||
|
const { errorEnvoieWalletToCardGetCommission } = this.props;
|
||||||
|
|
||||||
|
if (errorEnvoieWalletToCardGetCommission !== null) {
|
||||||
|
if (typeof errorEnvoieWalletToCardGetCommission.data !== 'undefined') {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("ERROR_LABLE"),
|
||||||
|
errorEnvoieWalletToCardGetCommission.data.error,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
text: I18n.t("OK"), onPress: () => {
|
||||||
|
this.props.getCommissionUserWalletToCardReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{ cancelable: false }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
updateLangue() {
|
||||||
|
this.props.navigation.setParams({name: I18n.t('DEPOSIT_TO_CARD')})
|
||||||
|
this.forceUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
modalConfirmTransaction = (data) => {
|
||||||
|
|
||||||
|
const frais = data.response.frais;
|
||||||
|
const montant_net = data.response.montant_net;
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Dialog.Container useNativeDriver={true} visible={this.state.isModalConfirmVisible}>
|
||||||
|
|
||||||
|
<Dialog.Title>{I18n.t('TRANSACTION_DETAIL')}</Dialog.Title>
|
||||||
|
|
||||||
|
<View>
|
||||||
|
|
||||||
|
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(frais, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={{ paddingVertical: 10 }}>
|
||||||
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
isModalConfirmVisible: false
|
||||||
|
});
|
||||||
|
}} />
|
||||||
|
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||||
|
this.setState({
|
||||||
|
isModalConfirmVisible: false,
|
||||||
|
isDataSubmit: true
|
||||||
|
});
|
||||||
|
this.props.envoieUserWalletToCardAction({
|
||||||
|
type: 2,
|
||||||
|
cvv: this.state.codeCVV,
|
||||||
|
id_wallet_user: this.state.wallet.id,
|
||||||
|
montant: this.state.montant,
|
||||||
|
password: this.state.password
|
||||||
|
});
|
||||||
|
this.props.getCommissionUserWalletToCardReset();
|
||||||
|
}} />
|
||||||
|
|
||||||
|
</Dialog.Container>
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
ckeckIfFieldIsOK(champ) {
|
||||||
|
return (isNil(champ) || isEqual(champ.length, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
isMontantValid = () => {
|
||||||
|
const {montant} = this.state;
|
||||||
|
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
||||||
|
return {
|
||||||
|
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
||||||
|
isValid: false
|
||||||
|
};
|
||||||
|
|
||||||
|
else if (!isNormalInteger(montant))
|
||||||
|
return {
|
||||||
|
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
|
||||||
|
isValid: false
|
||||||
|
};
|
||||||
|
|
||||||
|
else
|
||||||
|
return {
|
||||||
|
errorMessage: '',
|
||||||
|
isValid: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmitSendWalletToBank = () => {
|
||||||
|
const {montant, password, codeIban} = this.state;
|
||||||
|
|
||||||
|
if (this.ckeckIfFieldIsOK(codeIban)) {
|
||||||
|
if (!(codeIban.length >= 14 && codeIban <= 34))
|
||||||
|
this.codeIbanAnim.shake(800);
|
||||||
|
else
|
||||||
|
this.codeIbanAnim.shake(800);
|
||||||
|
} else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
||||||
|
this.montantAnim.shake(800);
|
||||||
|
} else if (this.ckeckIfFieldIsOK(password))
|
||||||
|
this.passwordAnim.shake(800);
|
||||||
|
else {
|
||||||
|
|
||||||
|
console.log("id wallet network", this.state.bank);
|
||||||
|
this.props.envoieUserWalletToBankAction({
|
||||||
|
type: 18,
|
||||||
|
id_wallet_agent: this.state.wallet.id,
|
||||||
|
id_wallet_network: this.state.wallet.id_network,
|
||||||
|
iban: codeIban,
|
||||||
|
id_bank: this.state.bank.id_bank,
|
||||||
|
montant: montant,
|
||||||
|
password: password
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
isDataSubmit: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
renderLoader = () => {
|
||||||
|
return (
|
||||||
|
<ProgressDialog
|
||||||
|
visible={this.props.loadingEnvoieWalletToBank}
|
||||||
|
title={I18n.t('LOADING')}
|
||||||
|
message={I18n.t('LOADING_INFO')}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{this.props.loadingEnvoieWalletToBank && this.renderLoader()}
|
||||||
|
{this.state.isDataSubmit && this.renderEnvoieWalletToBankResponse()}
|
||||||
|
<ScrollView style={styles.container}>
|
||||||
|
|
||||||
|
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_BANK')}</Text>
|
||||||
|
|
||||||
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.codeIbanAnim = comp
|
||||||
|
}}>
|
||||||
|
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||||
|
label={I18n.t('CODE_IBAN')}
|
||||||
|
iconColor={'#f95a25'}
|
||||||
|
iconSize={20}
|
||||||
|
value={this.state.codeIban}
|
||||||
|
onChangeText={(codeIban) => {
|
||||||
|
|
||||||
|
this.setState({codeIban})
|
||||||
|
}}
|
||||||
|
style={styles.input}
|
||||||
|
>
|
||||||
|
</Fumi>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.montantAnim = comp
|
||||||
|
}}>
|
||||||
|
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||||
|
label={I18n.t('AMOUNT')}
|
||||||
|
iconColor={'#f95a25'}
|
||||||
|
keyboardType='numeric'
|
||||||
|
iconSize={20}
|
||||||
|
value={this.state.montant}
|
||||||
|
onChangeText={(montant) => {
|
||||||
|
this.setState({montant})
|
||||||
|
}}
|
||||||
|
style={styles.input}
|
||||||
|
>
|
||||||
|
</Fumi>
|
||||||
|
<View style={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: responsiveWidth(82),
|
||||||
|
top: 35,
|
||||||
|
flexDirection: 'row'
|
||||||
|
}}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
width: 1,
|
||||||
|
borderLeftColor: '#f0f0f0',
|
||||||
|
height: 40,
|
||||||
|
left: -8,
|
||||||
|
top: -10,
|
||||||
|
borderLeftWidth: 1,
|
||||||
|
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
||||||
|
</View>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.passwordAnim = comp
|
||||||
|
}}>
|
||||||
|
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||||
|
label={I18n.t('PASSWORD')}
|
||||||
|
iconColor={'#f95a25'}
|
||||||
|
iconSize={20}
|
||||||
|
secureTextEntry={true}
|
||||||
|
value={this.state.password}
|
||||||
|
onChangeText={(password) => {
|
||||||
|
this.setState({password})
|
||||||
|
}}
|
||||||
|
style={styles.input}
|
||||||
|
>
|
||||||
|
</Fumi>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
|
<Button style={styles.btnvalide}
|
||||||
|
textStyle={styles.textbtnvalide}
|
||||||
|
onPress={() => {
|
||||||
|
this.onSubmitSendWalletToBank()
|
||||||
|
}}>
|
||||||
|
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||||
|
</ScrollView>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const maptStateToProps = state => ({
|
||||||
|
|
||||||
|
loadingEnvoieWalletToBank: state.envoieUserWalletToBank.loading,
|
||||||
|
resultEnvoieWalletToBank: state.envoieUserWalletToBank.result,
|
||||||
|
errorEnvoieWalletToBank: state.envoieUserWalletToBank.error,
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
|
||||||
|
envoieUserWalletToBankAction,
|
||||||
|
envoieUserWalletToBankReset,
|
||||||
|
|
||||||
|
}, dispatch);
|
||||||
|
|
||||||
|
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToBankAgent);
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: Color.primaryDarkColor,
|
||||||
|
},
|
||||||
|
textbtnvalide: {
|
||||||
|
color: 'white',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
},
|
||||||
|
bigtitle: {
|
||||||
|
color: 'white',
|
||||||
|
fontSize: 20,
|
||||||
|
flex: 1,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
textAlign: 'center',
|
||||||
|
margin: 20,
|
||||||
|
},
|
||||||
|
blockView: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 1
|
||||||
|
},
|
||||||
|
subbigtitle: {
|
||||||
|
color: 'white',
|
||||||
|
fontSize: 17,
|
||||||
|
textAlign: 'center',
|
||||||
|
margin: 5,
|
||||||
|
},
|
||||||
|
btnvalide: {
|
||||||
|
marginTop: 20,
|
||||||
|
marginLeft: 20,
|
||||||
|
marginRight: 20,
|
||||||
|
borderColor: 'transparent',
|
||||||
|
backgroundColor: Color.accentLightColor,
|
||||||
|
height: 52
|
||||||
|
},
|
||||||
|
btnSubmit: {
|
||||||
|
marginTop: 20,
|
||||||
|
borderColor: 'transparent',
|
||||||
|
backgroundColor: Color.accentLightColor,
|
||||||
|
height: 52,
|
||||||
|
width: "30%",
|
||||||
|
marginLeft: 20,
|
||||||
|
marginRight: 20,
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
height: 60,
|
||||||
|
marginTop: responsiveHeight(2),
|
||||||
|
marginLeft: responsiveWidth(5),
|
||||||
|
marginRight: responsiveWidth(5),
|
||||||
|
borderRadius: 5,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -4,7 +4,6 @@ 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 Dialog from "react-native-dialog";
|
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
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';
|
||||||
|
|
@ -12,14 +11,14 @@ import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||||
import {Fumi} from 'react-native-textinput-effects';
|
import {Fumi} from 'react-native-textinput-effects';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {bindActionCreators} from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import thousands from 'thousands';
|
|
||||||
import {Color} from '../../../config/Color';
|
import {Color} from '../../../config/Color';
|
||||||
import {FontWeight, Typography} from '../../../config/typography';
|
import {FontWeight, Typography} from '../../../config/typography';
|
||||||
import {store} from "../../../redux/store";
|
import {store} from "../../../redux/store";
|
||||||
import {IlinkEmitter} from '../../../utils/events';
|
import {IlinkEmitter} from '../../../utils/events';
|
||||||
import {readUser} from '../../../webservice/AuthApi';
|
import {readUser} from '../../../webservice/AuthApi';
|
||||||
import { envoieUserWalletToCardAction, envoieUserWalletToCardReset, getCommissionUserWalletToCardAction, getCommissionUserWalletToCardReset } from '../../../webservice/EnvoieUserApi';
|
import {envoieUserWalletToBankAction, envoieUserWalletToBankReset} from '../../../webservice/EnvoieUserApi';
|
||||||
import {isNormalInteger} from '../../../utils/UtilsFunction';
|
import {isNormalInteger} from '../../../utils/UtilsFunction';
|
||||||
|
|
||||||
let theme = require('../../../utils/theme.json');
|
let theme = require('../../../utils/theme.json');
|
||||||
let route = require('../../../route.json');
|
let route = require('../../../route.json');
|
||||||
|
|
||||||
|
|
@ -47,7 +46,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
headerTitleStyle: {
|
headerTitleStyle: {
|
||||||
color: "white"
|
color: "white"
|
||||||
},
|
},
|
||||||
title: I18n.t('ENVOIE_WALLET_TO_BANK')
|
title: I18n.t('DEPOSIT_WALLET_TO_BANK')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -56,18 +55,18 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
montant: null,
|
montant: null,
|
||||||
password: null,
|
password: null,
|
||||||
codeCVV: null,
|
codeIban: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
user: null,
|
user: null,
|
||||||
triggerSubmitClick: false,
|
triggerSubmitClick: false,
|
||||||
isSubmitClick: false,
|
isSubmitClick: false,
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response,
|
||||||
|
bank: this.props.navigation.state.params.bank
|
||||||
};
|
};
|
||||||
|
|
||||||
this.props.envoieUserWalletToCardReset();
|
this.props.envoieUserWalletToBankReset();
|
||||||
this.props.getCommissionUserWalletToCardReset();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,7 +86,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
|
|
||||||
console.log('PROPS', nextProps)
|
console.log('PROPS', nextProps)
|
||||||
|
|
||||||
if (nextProps.resultEnvoieWalletToCardGetCommission != null) {
|
/* if (nextProps.resultEnvoieWalletToCardGetCommission != null) {
|
||||||
|
|
||||||
if (typeof nextProps.resultEnvoieWalletToCardGetCommission.response !== 'undefined') {
|
if (typeof nextProps.resultEnvoieWalletToCardGetCommission.response !== 'undefined') {
|
||||||
|
|
||||||
|
|
@ -96,22 +95,22 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
isModalConfirmVisible: true
|
isModalConfirmVisible: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
renderEnvoieWalletToWalletResponse = () => {
|
renderEnvoieWalletToBankResponse = () => {
|
||||||
|
|
||||||
const { resultEnvoieWalletToCard, errorEnvoieWalletToCard } = this.props;
|
const {resultEnvoieWalletToBank, errorEnvoieWalletToBank} = this.props;
|
||||||
|
|
||||||
if (errorEnvoieWalletToCard !== null) {
|
if (errorEnvoieWalletToBank !== null) {
|
||||||
if (typeof errorEnvoieWalletToCard.data !== 'undefined') {
|
if (typeof errorEnvoieWalletToBank.data !== 'undefined') {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("ERROR_TRANSFER"),
|
I18n.t("ERROR_TRANSFER"),
|
||||||
errorEnvoieWalletToCard.data.error,
|
errorEnvoieWalletToBank.data.error,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.envoieUserWalletToCardReset();
|
this.props.envoieUserWalletToBankReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -120,15 +119,15 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultEnvoieWalletToCard !== null) {
|
if (resultEnvoieWalletToBank !== null) {
|
||||||
if (resultEnvoieWalletToCard.response !== null) {
|
if (resultEnvoieWalletToBank.response !== null) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("SUCCESS_TRANSFER"),
|
I18n.t("SUCCESS_TRANSFER"),
|
||||||
resultEnvoieWalletToCard.response,
|
resultEnvoieWalletToBank.response,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.envoieUserWalletToCardReset();
|
this.props.envoieUserWalletToBankReset();
|
||||||
IlinkEmitter.emit("refreshWallet");
|
IlinkEmitter.emit("refreshWallet");
|
||||||
this.props.navigation.pop();
|
this.props.navigation.pop();
|
||||||
}
|
}
|
||||||
|
|
@ -141,7 +140,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderDialogGetCommissionResponse = () => {
|
/* renderDialogGetCommissionResponse = () => {
|
||||||
|
|
||||||
const { errorEnvoieWalletToCardGetCommission } = this.props;
|
const { errorEnvoieWalletToCardGetCommission } = this.props;
|
||||||
|
|
||||||
|
|
@ -162,7 +161,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
|
|
@ -170,6 +169,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
modalConfirmTransaction = (data) => {
|
modalConfirmTransaction = (data) => {
|
||||||
|
|
||||||
const frais = data.response.frais;
|
const frais = data.response.frais;
|
||||||
|
|
@ -238,6 +238,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
ckeckIfFieldIsOK(champ) {
|
ckeckIfFieldIsOK(champ) {
|
||||||
return (isNil(champ) || isEqual(champ.length, 0));
|
return (isNil(champ) || isEqual(champ.length, 0));
|
||||||
|
|
@ -264,27 +265,34 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmitSendWalletToCard = () => {
|
onSubmitSendWalletToBank = () => {
|
||||||
const { codeCVV, montant, password } = this.state;
|
const {montant, password, codeIban} = this.state;
|
||||||
|
|
||||||
if (this.ckeckIfFieldIsOK(codeCVV) && codeCVV === 3)
|
if (this.ckeckIfFieldIsOK(codeIban)) {
|
||||||
this.codeCVVAnim.shake(800);
|
if (!(codeIban.length >= 14 && codeIban <= 34))
|
||||||
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
this.codeIbanAnim.shake(800);
|
||||||
|
else
|
||||||
|
this.codeIbanAnim.shake(800);
|
||||||
|
} else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
||||||
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 {
|
||||||
|
|
||||||
this.props.getCommissionUserWalletToCardAction({
|
console.log("id wallet network", this.state.bank);
|
||||||
type: 2,
|
this.props.envoieUserWalletToBankAction({
|
||||||
|
type: 4,
|
||||||
id_wallet_user: this.state.wallet.id,
|
id_wallet_user: this.state.wallet.id,
|
||||||
montant: this.state.montant,
|
id_wallet_network: this.state.wallet.id_wallet_network,
|
||||||
|
iban: codeIban,
|
||||||
|
id_bank: this.state.bank.id_bank,
|
||||||
|
montant: montant,
|
||||||
|
password: password
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
triggerSubmitClick: true
|
isDataSubmit: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -292,7 +300,7 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
renderLoader = () => {
|
renderLoader = () => {
|
||||||
return (
|
return (
|
||||||
<ProgressDialog
|
<ProgressDialog
|
||||||
visible={this.props.loadingEnvoieWalletToCard || this.props.loadingEnvoieWalletToCardGetCommission}
|
visible={this.props.loadingEnvoieWalletToBank}
|
||||||
title={I18n.t('LOADING')}
|
title={I18n.t('LOADING')}
|
||||||
message={I18n.t('LOADING_INFO')}
|
message={I18n.t('LOADING_INFO')}
|
||||||
/>
|
/>
|
||||||
|
|
@ -300,37 +308,34 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { resultEnvoieWalletToCardGetCommission } = this.props;
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(this.props.loadingEnvoieWalletToCard || this.props.loadingEnvoieWalletToCardGetCommission) && this.renderLoader()}
|
{this.props.loadingEnvoieWalletToBank && this.renderLoader()}
|
||||||
{this.state.isDataSubmit && this.renderEnvoieWalletToWalletResponse()}
|
{this.state.isDataSubmit && this.renderEnvoieWalletToBankResponse()}
|
||||||
{this.state.triggerSubmitClick && this.renderDialogGetCommissionResponse()}
|
|
||||||
{
|
|
||||||
(resultEnvoieWalletToCardGetCommission !== null) &&
|
|
||||||
(typeof resultEnvoieWalletToCardGetCommission.response !== 'undefined') &&
|
|
||||||
this.modalConfirmTransaction(resultEnvoieWalletToCardGetCommission)
|
|
||||||
}
|
|
||||||
<ScrollView style={styles.container}>
|
<ScrollView style={styles.container}>
|
||||||
|
|
||||||
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_BANK')}</Text>
|
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_BANK')}</Text>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.codeCVVAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
|
this.codeIbanAnim = comp
|
||||||
|
}}>
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||||
label={I18n.t('CODE_IBAN')}
|
label={I18n.t('CODE_IBAN')}
|
||||||
iconColor={'#f95a25'}
|
iconColor={'#f95a25'}
|
||||||
iconSize={20}
|
iconSize={20}
|
||||||
value={this.state.codeCVV}
|
value={this.state.codeIban}
|
||||||
onChangeText={(codeCVV) => {
|
onChangeText={(codeIban) => {
|
||||||
|
|
||||||
this.setState({ codeCVV })
|
this.setState({codeIban})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</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'}
|
||||||
|
|
@ -364,7 +369,9 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
</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'}
|
||||||
|
|
@ -381,7 +388,9 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
|
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
onPress={() => { /* this.onSubmitSendWalletToCard(); */ }}>
|
onPress={() => {
|
||||||
|
this.onSubmitSendWalletToBank()
|
||||||
|
}}>
|
||||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</>
|
</>
|
||||||
|
|
@ -391,22 +400,16 @@ class EnvoieWalletToBankUser extends Component {
|
||||||
|
|
||||||
const maptStateToProps = state => ({
|
const maptStateToProps = state => ({
|
||||||
|
|
||||||
loadingEnvoieWalletToCard: state.envoieUserWalletToCardReducer.loading,
|
loadingEnvoieWalletToBank: state.envoieUserWalletToBank.loading,
|
||||||
resultEnvoieWalletToCard: state.envoieUserWalletToCardReducer.result,
|
resultEnvoieWalletToBank: state.envoieUserWalletToBank.result,
|
||||||
errorEnvoieWalletToCard: state.envoieUserWalletToCardReducer.error,
|
errorEnvoieWalletToBank: state.envoieUserWalletToBank.error,
|
||||||
|
|
||||||
loadingEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.loading,
|
|
||||||
resultEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.result,
|
|
||||||
errorEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.error,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
|
||||||
envoieUserWalletToCardAction,
|
envoieUserWalletToBankAction,
|
||||||
envoieUserWalletToCardReset,
|
envoieUserWalletToBankReset,
|
||||||
|
|
||||||
getCommissionUserWalletToCardAction,
|
|
||||||
getCommissionUserWalletToCardReset
|
|
||||||
|
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class EnvoieWalletToCashUser extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -631,8 +631,8 @@ class EnvoieWalletToCashUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class EnvoieWalletToWalletUser extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -603,8 +603,8 @@ class EnvoieWalletToWalletUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import I18n from 'react-native-i18n';
|
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import Toast from 'react-native-root-toast';
|
import Toast from 'react-native-root-toast';
|
||||||
import {Color} from '../config/Color';
|
import {Color} from '../config/Color';
|
||||||
|
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
let route = require('./../route.json');
|
let route = require('./../route.json');
|
||||||
|
|
||||||
|
|
@ -69,13 +69,13 @@ export const isEmptyObject = (obj) => {
|
||||||
export const identityPieces = () => {
|
export const identityPieces = () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: I18n.t('IDENTITY_CARD')
|
name: 'IDENTITY_CARD'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('PASSEPORT')
|
name: 'PASSEPORT'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('OTHER_IDENTITY_PIECE')
|
name: 'OTHER_IDENTITY_PIECE'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -83,10 +83,10 @@ export const identityPieces = () => {
|
||||||
export const withdrawalMode = () => {
|
export const withdrawalMode = () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: I18n.t('WITHDRAWAL_IN_CASH')
|
name: 'WITHDRAWAL_IN_CASH'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('TRANSFER_IN_ACCOUNT')
|
name: 'TRANSFER_IN_ACCOUNT'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -94,10 +94,10 @@ export const withdrawalMode = () => {
|
||||||
export const typeCaution = () => {
|
export const typeCaution = () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: I18n.t('GROUP')
|
name: 'GROUP'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('INDIVIDUAL')
|
name: 'INDIVIDUAL'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -105,10 +105,10 @@ export const typeCaution = () => {
|
||||||
export const typeEpargne = () => {
|
export const typeEpargne = () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: I18n.t('SIMPLE')
|
name: 'SIMPLE'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('BLOCKED')
|
name: 'BLOCKED'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -116,10 +116,10 @@ export const typeEpargne = () => {
|
||||||
export const typeIdIDestinataire = () => {
|
export const typeIdIDestinataire = () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: I18n.t('PHONE')
|
name: 'PHONE'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('CODE_WALLET')
|
name: 'CODE_WALLET'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -166,11 +166,11 @@ export const walletActifData = () => {
|
||||||
|
|
||||||
export const inputCardSource = () => [
|
export const inputCardSource = () => [
|
||||||
{
|
{
|
||||||
name: I18n.t('NUMERO_DE_SERIE'),
|
name: 'NUMERO_DE_SERIE',
|
||||||
value: 'serial-number'
|
value: 'serial-number'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: I18n.t('CREDIT_CARD'),
|
name: 'CREDIT_CARD',
|
||||||
value: 'credit-card'
|
value: 'credit-card'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -187,11 +187,11 @@ export const transactionHistoryLabel = () => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'cash',
|
icon: 'cash',
|
||||||
label: I18n.t('AMOUNT_LABEL')
|
label: 'AMOUNT_LABEL'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'account-arrow-right',
|
icon: 'account-arrow-right',
|
||||||
label: I18n.t('DESTINATAIRE')
|
label: 'DESTINATAIRE'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'calendar-clock',
|
icon: 'calendar-clock',
|
||||||
|
|
@ -211,15 +211,15 @@ export const transactionHistoryIlinkLabel = () => {
|
||||||
}, */
|
}, */
|
||||||
{
|
{
|
||||||
icon: 'cash',
|
icon: 'cash',
|
||||||
label: I18n.t('AMOUNT_LABEL')
|
label: 'AMOUNT_LABEL'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'account-arrow-right',
|
icon: 'account-arrow-right',
|
||||||
label: I18n.t('DESTINATAIRE')
|
label: 'DESTINATAIRE'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'calendar-clock',
|
icon: 'calendar-clock',
|
||||||
label: 'Date'
|
label: 'DATE'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -239,7 +239,7 @@ export const transactionHistoryNanoCreditLabel = () => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'cash',
|
icon: 'cash',
|
||||||
label: I18n.t('AMOUNT_LABEL')
|
label: 'AMOUNT_LABEL'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'calendar-clock',
|
icon: 'calendar-clock',
|
||||||
|
|
@ -268,81 +268,44 @@ export const transactionHistoryUser = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const displayTransactionType = (transactionType) => {
|
export const displayTransactionType = (transactionType) => {
|
||||||
return isEqual(transactionType, 'E') ? I18n.t('SAVING') : I18n.t('NANO_CREDIT');
|
return isEqual(transactionType, 'E') ? 'SAVING' : 'NANO_CREDIT';
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionWalletToBank = {
|
export const optionWalletToBank = {
|
||||||
title: I18n.t('DEPOSIT_TO_BANK'),
|
title: 'DEPOSIT_TO_BANK',
|
||||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
options: [
|
options: []
|
||||||
{
|
|
||||||
type: 'WALLET_TO_BANK_USER',
|
|
||||||
screen: route.envoieWalletToBankUser,
|
|
||||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
|
||||||
title: 'Banque numéro 1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'WALLET_TO_BANK_USER',
|
|
||||||
screen: route.envoieWalletToBankUser,
|
|
||||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
|
||||||
title: 'Banque numéro 2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'WALLET_TO_BANK_USER',
|
|
||||||
screen: route.envoieWalletToBankUser,
|
|
||||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
|
||||||
title: 'Banque numéro 3',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'WALLET_TO_BANK_USER',
|
|
||||||
screen: route.envoieWalletToBankUser,
|
|
||||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
|
||||||
title: 'Banque numéro 4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'WALLET_TO_BANK_USER',
|
|
||||||
screen: route.envoieWalletToBankUser,
|
|
||||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
|
||||||
title: 'Banque numéro 5',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'WALLET_TO_BANK_USER',
|
|
||||||
screen: route.paiementFacture,
|
|
||||||
icon: 'http://test.ilink-app.com:8080/mobilebackend/datas/img/network/ilink-world-logo.png',
|
|
||||||
title: 'Banque numéro 6',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionDepotScreen = {
|
export const optionDepotScreen = {
|
||||||
type: 'DEPOT',
|
type: 'DEPOT',
|
||||||
title: I18n.t('ENVOIE_ARGENT'),
|
title: 'ENVOIE_ARGENT',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.envoieCashVersWalletAgent,
|
screen: route.envoieCashVersWalletAgent,
|
||||||
icon: 'wallet',
|
icon: 'wallet',
|
||||||
title: I18n.t('DEPOSIT_CASH_TO_WALLET'),
|
title: 'DEPOSIT_CASH_TO_WALLET',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.envoieCashVersAutreWalletAgent,
|
screen: route.envoieCashVersAutreWalletAgent,
|
||||||
icon: 'cash-refund',
|
icon: 'cash-refund',
|
||||||
title: I18n.t('DEPOSIT_CASH_TO_OTHER_WALLET'),
|
title: 'DEPOSIT_CASH_TO_OTHER_WALLET',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.envoieCashVersCarteAgent,
|
screen: route.envoieCashVersCarteAgent,
|
||||||
icon: 'credit-card',
|
icon: 'credit-card',
|
||||||
title: I18n.t('DEPOSIT_CASH_TO_VISA'),
|
title: 'DEPOSIT_CASH_TO_VISA',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.envoiCashVersCashAgent,
|
screen: route.envoiCashVersCashAgent,
|
||||||
icon: 'cash-multiple',
|
icon: 'cash-multiple',
|
||||||
title: I18n.t('DEPOSIT_CASH_TO_CASH'),
|
title: 'DEPOSIT_CASH_TO_CASH',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
icon: 'bank-transfer-in',
|
icon: 'bank-transfer-in',
|
||||||
title: I18n.t('DEPOSIT_CASH_TO_BANK'),
|
title: 'DEPOSIT_CASH_TO_BANK',
|
||||||
subScreenOption: optionWalletToBank,
|
subScreenOption: optionWalletToBank,
|
||||||
type: 'WALLET_TO_BANK',
|
type: 'WALLET_TO_BANK',
|
||||||
},
|
},
|
||||||
|
|
@ -351,70 +314,70 @@ export const optionDepotScreen = {
|
||||||
|
|
||||||
export const optionRetraitScreen = {
|
export const optionRetraitScreen = {
|
||||||
type: 'RETRAIT',
|
type: 'RETRAIT',
|
||||||
title: I18n.t('RETRAIT_ARGENT'),
|
title: 'RETRAIT_ARGENT',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.retraitEnCashAgent,
|
screen: route.retraitEnCashAgent,
|
||||||
icon: 'cash',
|
icon: 'cash',
|
||||||
title: I18n.t('WITHDRAWAL_IN_CASH'),
|
title: 'WITHDRAWAL_IN_CASH',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.retraitCarteVersCashAgent,
|
screen: route.retraitCarteVersCashAgent,
|
||||||
icon: 'credit-card',
|
icon: 'credit-card',
|
||||||
title: I18n.t('WITHDRAWAL_CARD_TO_CASH_AGENT'),
|
title: 'WITHDRAWAL_CARD_TO_CASH_AGENT',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionRetraitUserScreen = {
|
export const optionRetraitUserScreen = {
|
||||||
type: 'RETRAIT_USER',
|
type: 'RETRAIT_USER',
|
||||||
title: I18n.t('RETRAIT_ARGENT'),
|
title: 'RETRAIT_ARGENT',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.retraitWalletVersCashUser,
|
screen: route.retraitWalletVersCashUser,
|
||||||
icon: 'wallet',
|
icon: 'wallet',
|
||||||
title: I18n.t('WITHDRAWAL_WALLET_TO_CASH'),
|
title: 'WITHDRAWAL_WALLET_TO_CASH',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.retraitCarteVersCashUser,
|
screen: route.retraitCarteVersCashUser,
|
||||||
icon: 'credit-card-refund',
|
icon: 'credit-card-refund',
|
||||||
title: I18n.t('WITHDRAWAL_CARD_TO_CASH'),
|
title: 'WITHDRAWAL_CARD_TO_CASH',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.retraitCarteVersWalletUser,
|
screen: route.retraitCarteVersWalletUser,
|
||||||
icon: 'credit-card',
|
icon: 'credit-card',
|
||||||
title: I18n.t('WITHDRAWAL_CARD_TO_WALLET'),
|
title: 'WITHDRAWAL_CARD_TO_WALLET',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionDepotUserScreen = {
|
export const optionDepotUserScreen = {
|
||||||
type: 'DEPOT_USER',
|
type: 'DEPOT_USER',
|
||||||
title: I18n.t('ENVOIE_ARGENT'),
|
title: 'ENVOIE_ARGENT',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.envoieWalletToWalletUser,
|
screen: route.envoieWalletToWalletUser,
|
||||||
icon: 'wallet',
|
icon: 'wallet',
|
||||||
title: I18n.t('DEPOSIT_WALLET_TO_WALLET'),
|
title: 'DEPOSIT_WALLET_TO_WALLET',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.envoieWalletToCashUser,
|
screen: route.envoieWalletToCashUser,
|
||||||
icon: 'cash-refund',
|
icon: 'cash-refund',
|
||||||
title: I18n.t('DEPOSIT_TO_CASH'),
|
title: 'DEPOSIT_TO_CASH',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.envoieWalletToCardUser,
|
screen: route.envoieWalletToCardUser,
|
||||||
icon: 'credit-card',
|
icon: 'credit-card',
|
||||||
title: I18n.t('DEPOSIT_TO_CARD'),
|
title: 'DEPOSIT_TO_CARD',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'WALLET_TO_BANK',
|
type: 'WALLET_TO_BANK',
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
icon: 'bank-transfer-in',
|
icon: 'bank-transfer-in',
|
||||||
title: I18n.t('DEPOSIT_TO_BANK'),
|
title: 'DEPOSIT_TO_BANK',
|
||||||
subScreenOption: optionWalletToBank
|
subScreenOption: optionWalletToBank
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -422,91 +385,90 @@ export const optionDepotUserScreen = {
|
||||||
|
|
||||||
export const optionIdentificationScreen = {
|
export const optionIdentificationScreen = {
|
||||||
type: 'IDENTIFICATION',
|
type: 'IDENTIFICATION',
|
||||||
title: I18n.t('IDENTIFICATION'),
|
title: 'IDENTIFICATION',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.createIdentification,
|
screen: route.createIdentification,
|
||||||
icon: 'pencil-plus',
|
icon: 'pencil-plus',
|
||||||
title: I18n.t('CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN'),
|
title: 'CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.validateIdentification,
|
screen: route.validateIdentification,
|
||||||
icon: 'check-circle',
|
icon: 'check-circle',
|
||||||
title: I18n.t('VALIDATE_IDENTIFICATION_DESCRIPTION'),
|
title: 'VALIDATE_IDENTIFICATION_DESCRIPTION',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionIdentificationUserScreen = {
|
export const optionIdentificationUserScreen = {
|
||||||
type: 'IDENTIFICATION',
|
type: 'IDENTIFICATION',
|
||||||
title: I18n.t('IDENTIFICATION'),
|
title: 'IDENTIFICATION',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.createIdentificationUser,
|
screen: route.createIdentificationUser,
|
||||||
icon: 'pencil-plus',
|
icon: 'pencil-plus',
|
||||||
title: I18n.t('CREATE_MY_IDENTIFICATION'),
|
title: 'CREATE_MY_IDENTIFICATION',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.modifyIdentificationUser,
|
screen: route.modifyIdentificationUser,
|
||||||
icon: 'pencil',
|
icon: 'pencil',
|
||||||
title: I18n.t('MODIFY_IDENTIFICATION'),
|
title: 'MODIFY_IDENTIFICATION',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionNanoCreditScreen = {
|
export const optionNanoCreditScreen = {
|
||||||
type: 'NANO_CREDIT',
|
type: 'NANO_CREDIT',
|
||||||
title: I18n.t('NANO_CREDIT'),
|
title: 'NANO_CREDIT',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.createGroupNanoCredit,
|
|
||||||
icon: 'account-multiple',
|
icon: 'account-multiple',
|
||||||
title: I18n.t('MANAGE_GROUP'),
|
title: 'MANAGE_GROUP',
|
||||||
screen: route.groupNanoCredit
|
screen: route.groupNanoCredit
|
||||||
},
|
},
|
||||||
/* {
|
/* {
|
||||||
screen: "",
|
screen: "",
|
||||||
icon: 'account-multiple-plus',
|
icon: 'account-multiple-plus',
|
||||||
title: I18n.t('JOIN_GROUP'),
|
title: 'JOIN_GROUP',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: "",
|
screen: "",
|
||||||
icon: 'account-card-details',
|
icon: 'account-card-details',
|
||||||
title: I18n.t('OPEN_ACCOUNT'),
|
title: 'OPEN_ACCOUNT',
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
/* {
|
/* {
|
||||||
screen: route.askNanoCredit,
|
screen: route.askNanoCredit,
|
||||||
icon: 'cash',
|
icon: 'cash',
|
||||||
title: I18n.t('MANAGE_CREDIT'),
|
title: 'MANAGE_CREDIT',
|
||||||
}, */
|
}, */
|
||||||
{
|
{
|
||||||
title: I18n.t('DEMAND_NANO_CREDIT'),
|
title: 'DEMAND_NANO_CREDIT',
|
||||||
screen: route.askNanoCredit,
|
screen: route.askNanoCredit,
|
||||||
icon: 'cash'
|
icon: 'cash'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: I18n.t('REFUND_NANO_CREDIT'),
|
title: 'REFUND_NANO_CREDIT',
|
||||||
screen: route.refundNanoCreditUser,
|
screen: route.refundNanoCreditUser,
|
||||||
icon: "cash-refund"
|
icon: "cash-refund"
|
||||||
},
|
},
|
||||||
/* {
|
/* {
|
||||||
screen: "",
|
screen: "",
|
||||||
icon: 'briefcase-edit',
|
icon: 'briefcase-edit',
|
||||||
title: I18n.t('MANAGE_SAVINGS'),
|
title: 'MANAGE_SAVINGS',
|
||||||
}, */
|
}, */
|
||||||
{
|
{
|
||||||
screen: route.epargnerArgentUser,
|
screen: route.epargnerArgentUser,
|
||||||
icon: 'cash-register',
|
icon: 'cash-register',
|
||||||
title: I18n.t('SAVE_MONEY'),
|
title: 'SAVE_MONEY',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
screen: route.casserEpargneUser,
|
screen: route.casserEpargneUser,
|
||||||
icon: 'cash-multiple',
|
icon: 'cash-multiple',
|
||||||
title: I18n.t('BREAK_EPARGNE'),
|
title: 'BREAK_EPARGNE',
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
@ -514,20 +476,20 @@ export const optionNanoCreditScreen = {
|
||||||
|
|
||||||
export const optionNanoCreditAgentScreen = {
|
export const optionNanoCreditAgentScreen = {
|
||||||
type: 'NANO_CREDIT',
|
type: 'NANO_CREDIT',
|
||||||
title: I18n.t('NANO_CREDIT'),
|
title: 'NANO_CREDIT',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
screen: route.cautionNanoCreditAgent,
|
screen: route.cautionNanoCreditAgent,
|
||||||
icon: 'cash',
|
icon: 'cash',
|
||||||
title: I18n.t('CAUTION_CREDIT'),
|
title: 'CAUTION_CREDIT',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionPaiementEauElectricite = {
|
export const optionPaiementEauElectricite = {
|
||||||
title: I18n.t('PAIEMENT_FACTURE'),
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_EAU_ELECTRICITE',
|
type: 'PAIEMENT_EAU_ELECTRICITE',
|
||||||
|
|
@ -569,8 +531,8 @@ export const optionPaiementEauElectricite = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionPaiementCreditTelephonique = {
|
export const optionPaiementCreditTelephonique = {
|
||||||
title: I18n.t('PAIEMENT_FACTURE'),
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
type: 'PAIEMENT_CREDIT_TELEPHONE',
|
||||||
|
|
@ -612,8 +574,8 @@ export const optionPaiementCreditTelephonique = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionPaiementAbonnementTV = {
|
export const optionPaiementAbonnementTV = {
|
||||||
title: I18n.t('PAIEMENT_FACTURE'),
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_ABONNEMENT_TV',
|
type: 'PAIEMENT_ABONNEMENT_TV',
|
||||||
|
|
@ -655,8 +617,8 @@ export const optionPaiementAbonnementTV = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionPaiementEcole = {
|
export const optionPaiementEcole = {
|
||||||
title: I18n.t('PAIEMENT_FACTURE'),
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: I18n.t('CHOOSE_OPERATOR'),
|
subTitle: 'CHOOSE_OPERATOR',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'PAIEMENT_ECOLE',
|
type: 'PAIEMENT_ECOLE',
|
||||||
|
|
@ -699,34 +661,34 @@ export const optionPaiementEcole = {
|
||||||
|
|
||||||
export const optionPaiementFacture = {
|
export const optionPaiementFacture = {
|
||||||
type: 'FACTURE',
|
type: 'FACTURE',
|
||||||
title: I18n.t('PAIEMENT_FACTURE'),
|
title: 'PAIEMENT_FACTURE',
|
||||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
subTitle: 'CHOOSE_OPTION',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 'FACTURE_WATER_ELECTRICITY',
|
type: 'FACTURE_WATER_ELECTRICITY',
|
||||||
icon: 'water',
|
icon: 'water',
|
||||||
title: 'Paiement eau/électricité',
|
title: 'PAIEMENT_EAU_ELECTRICITY',
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
subScreenOption: optionPaiementEauElectricite
|
subScreenOption: optionPaiementEauElectricite
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'FACTURE_SCHOOL',
|
type: 'FACTURE_SCHOOL',
|
||||||
icon: 'school',
|
icon: 'school',
|
||||||
title: 'Paiement école',
|
title: 'PAIEMENT_ECOLE',
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
subScreenOption: optionPaiementEcole
|
subScreenOption: optionPaiementEcole
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'FACTURE_PHONE',
|
type: 'FACTURE_PHONE',
|
||||||
icon: 'phone-classic',
|
icon: 'phone-classic',
|
||||||
title: 'Paiement crédit téléphonique',
|
title: 'PAIEMENT_CREDIT_TELEPHONIQUE',
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
subScreenOption: optionPaiementCreditTelephonique
|
subScreenOption: optionPaiementCreditTelephonique
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'FACTURE_TV',
|
type: 'FACTURE_TV',
|
||||||
icon: 'television-classic',
|
icon: 'television-classic',
|
||||||
title: 'Paiement abonnement TV',
|
title: 'PAIEMENT_ABONNEMENT_TV',
|
||||||
screen: route.operateurOptionSelect,
|
screen: route.operateurOptionSelect,
|
||||||
subScreenOption: optionPaiementAbonnementTV
|
subScreenOption: optionPaiementAbonnementTV
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
"ASK_MEMBERS": "Membership applications",
|
"ASK_MEMBERS": "Membership applications",
|
||||||
"MY_ACCOUNT": "My account",
|
"MY_ACCOUNT": "My account",
|
||||||
"WALLET": "Wallet",
|
"WALLET": "Wallet",
|
||||||
|
"NO_BANK_AVAILABLE": "No bank available",
|
||||||
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
||||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
||||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
||||||
|
|
@ -111,7 +112,7 @@
|
||||||
"DEPOSIT_WALLET_TO_BANK": "Your Wallet to bank",
|
"DEPOSIT_WALLET_TO_BANK": "Your Wallet to bank",
|
||||||
"ENVOIE_WALLET_TO_BANK": "Send Wallet to bank",
|
"ENVOIE_WALLET_TO_BANK": "Send Wallet to bank",
|
||||||
"DEPOSIT_CASH_TO_CASH": "Cash to cash",
|
"DEPOSIT_CASH_TO_CASH": "Cash to cash",
|
||||||
"ENVOIE_CASH_TO_CASH": "Send money in cash to cash",
|
"ENVOIE_CASH_TO_CASH": "Send money from cash to cash",
|
||||||
"TRANSACTION_DETAIL": "Transaction detail",
|
"TRANSACTION_DETAIL": "Transaction detail",
|
||||||
"DEMAND_DETAIL": "Demand detail",
|
"DEMAND_DETAIL": "Demand detail",
|
||||||
"CODE_IBAN": "IBAN Code",
|
"CODE_IBAN": "IBAN Code",
|
||||||
|
|
@ -140,7 +141,7 @@
|
||||||
"OPEN_ACCOUNT": "Open account",
|
"OPEN_ACCOUNT": "Open account",
|
||||||
"MANAGE_CREDIT": "Manage credit",
|
"MANAGE_CREDIT": "Manage credit",
|
||||||
"MANAGE_SAVINGS": "Manage savings",
|
"MANAGE_SAVINGS": "Manage savings",
|
||||||
"INIT_COUNTRY": "Departure countryt",
|
"INIT_COUNTRY": "Departure country",
|
||||||
"FINAL_COUNTRY": "Arrival country",
|
"FINAL_COUNTRY": "Arrival country",
|
||||||
"INIT_AMOUNT": "Init amount",
|
"INIT_AMOUNT": "Init amount",
|
||||||
"FINAL_AMOUNT": "Final amount",
|
"FINAL_AMOUNT": "Final amount",
|
||||||
|
|
@ -161,11 +162,15 @@
|
||||||
"DEMAND_NANO_CREDIT": "Nano credit demand",
|
"DEMAND_NANO_CREDIT": "Nano credit demand",
|
||||||
"REFUND_NANO_CREDIT": "Refund nano credit",
|
"REFUND_NANO_CREDIT": "Refund nano credit",
|
||||||
"REFUND_DONE": "Refund done",
|
"REFUND_DONE": "Refund done",
|
||||||
"SAVE_MONEY": "Epargner de l'argent",
|
"SAVE_MONEY": "Save money",
|
||||||
"SAVE_MONEY_TYPE": "Savings type",
|
"SAVE_MONEY_TYPE": "Savings type",
|
||||||
"CAUTION_CREDIT": "Caution credit demand",
|
"CAUTION_CREDIT": "Caution credit demand",
|
||||||
"ID_DEMAND": "Demand ID",
|
"ID_DEMAND": "Demand ID",
|
||||||
|
"DATE": "Date",
|
||||||
|
"PAIEMENT_EAU_ELECTRICITY": "Water/electricity bill",
|
||||||
|
"PAIEMENT_ECOLE": "School fees",
|
||||||
|
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",
|
||||||
|
"PAIEMENT_ABONNEMENT_TV": "TV subscription",
|
||||||
"DEMAND_DATE": "Demand date",
|
"DEMAND_DATE": "Demand date",
|
||||||
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
||||||
"DATE_REMBOURSEMENT": "Refund date",
|
"DATE_REMBOURSEMENT": "Refund date",
|
||||||
|
|
@ -174,7 +179,7 @@
|
||||||
"FINAL_DATE": "End date",
|
"FINAL_DATE": "End date",
|
||||||
"CASSATION_DATE": "Cassation date",
|
"CASSATION_DATE": "Cassation date",
|
||||||
"VALIDATION_DATE": "Validation date",
|
"VALIDATION_DATE": "Validation date",
|
||||||
|
"HISTORY_DETAIL": "History detail",
|
||||||
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
||||||
"PAIEMENT_FACTURE": "Bill payment",
|
"PAIEMENT_FACTURE": "Bill payment",
|
||||||
"NUMERO_ABONNE": "Subscriber number",
|
"NUMERO_ABONNE": "Subscriber number",
|
||||||
|
|
@ -273,6 +278,7 @@
|
||||||
"IDENTITY_NUMBER": "N° of piece",
|
"IDENTITY_NUMBER": "N° of piece",
|
||||||
"IDENTITY_PIECE_EXPIRY_DATE": "Expiry date",
|
"IDENTITY_PIECE_EXPIRY_DATE": "Expiry date",
|
||||||
"LAST_STEP": "Last step",
|
"LAST_STEP": "Last step",
|
||||||
|
"ID_TRANSACTION": "Transaction ID",
|
||||||
"ACTIVE_ACCOUNT": "Activate the account !",
|
"ACTIVE_ACCOUNT": "Activate the account !",
|
||||||
"ACTIVE_USER": "Active",
|
"ACTIVE_USER": "Active",
|
||||||
"LAST_STEP_TEXT": "Activate your account using the verification code that was sent to you on your e-mail address and on your phone number",
|
"LAST_STEP_TEXT": "Activate your account using the verification code that was sent to you on your e-mail address and on your phone number",
|
||||||
|
|
@ -437,14 +443,14 @@
|
||||||
"CREATE_MY_IDENTIFICATION": "Create my identification",
|
"CREATE_MY_IDENTIFICATION": "Create my identification",
|
||||||
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
|
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
|
||||||
"NOT_VALIDATED": "Your identicaiton is not yet validated",
|
"NOT_VALIDATED": "Your identicaiton is not yet validated",
|
||||||
"ALREADY_VALIDATED": "The identification of this client has already been validated",
|
"ALREADY_VALIDATED": "The identification of this customer has already been validated",
|
||||||
"MODIFY_IDENTIFICATION": "Modify my identification",
|
"MODIFY_IDENTIFICATION": "Modify my identification",
|
||||||
"NOT_YET_IDENTIFY": "You are not yet identified",
|
"NOT_YET_IDENTIFY": "You are not yet identified",
|
||||||
"IDENTIFICATION": " Identification",
|
"IDENTIFICATION": " Identification",
|
||||||
"CREATION_IDENTIFICATION": "Creation",
|
"CREATION_IDENTIFICATION": "Creation",
|
||||||
"CREATION_IDENTIFICATION_CLIENT": "Identify me",
|
"CREATION_IDENTIFICATION_CLIENT": "Identify me",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a customer",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
|
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a customer",
|
||||||
"VALIDATE_IDENTIFICATION": "Validation",
|
"VALIDATE_IDENTIFICATION": "Validation",
|
||||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
||||||
"IDENTIFICATION_INFORMATION": "Identification information",
|
"IDENTIFICATION_INFORMATION": "Identification information",
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
||||||
"DESTINATAIRE": "Destinataire",
|
"DESTINATAIRE": "Destinataire",
|
||||||
"ERROR_LABEL": "Erreur",
|
"ERROR_LABEL": "Erreur",
|
||||||
|
"NO_BANK_AVAILABLE": "Aucune banque disponible",
|
||||||
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
||||||
"SUCCESS": "Succès",
|
"SUCCESS": "Succès",
|
||||||
"ETAT": "Etat",
|
"ETAT": "Etat",
|
||||||
|
|
@ -172,7 +173,11 @@
|
||||||
"REFUND_DONE": "Remboursement effectué",
|
"REFUND_DONE": "Remboursement effectué",
|
||||||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||||
"ID_DEMAND": "Identifiant de la demande",
|
"ID_DEMAND": "Identifiant de la demande",
|
||||||
|
"PAIEMENT_EAU_ELECTRICITY": "Paiement eau/électricité",
|
||||||
|
"PAIEMENT_ECOLE": "Paiement école",
|
||||||
|
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
|
||||||
|
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
|
||||||
|
"DATE": "Date",
|
||||||
"DEMAND_DATE": "Date de la demande",
|
"DEMAND_DATE": "Date de la demande",
|
||||||
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
||||||
"DATE_REMBOURSEMENT": "Date de remboursement",
|
"DATE_REMBOURSEMENT": "Date de remboursement",
|
||||||
|
|
@ -181,7 +186,7 @@
|
||||||
"FINAL_DATE": "Date de fin",
|
"FINAL_DATE": "Date de fin",
|
||||||
"CASSATION_DATE": "Date de cassation",
|
"CASSATION_DATE": "Date de cassation",
|
||||||
"VALIDATION_DATE": "Date de validation",
|
"VALIDATION_DATE": "Date de validation",
|
||||||
|
"HISTORY_DETAIL": "Détail de l'historique",
|
||||||
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
||||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
import {store} from "../redux/store";
|
||||||
|
import axios from "axios";
|
||||||
|
import {getBankUrl} from "./IlinkConstants";
|
||||||
|
import I18n from "react-native-i18n";
|
||||||
|
import {
|
||||||
|
fetchGetBankListError,
|
||||||
|
fetchGetBankListPending,
|
||||||
|
fetchGetBankListReset,
|
||||||
|
fetchGetBankListSucsess
|
||||||
|
} from "../redux/actions/BankAction";
|
||||||
|
|
||||||
|
export const getBankListAction = (idWallet) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetBankListPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${getBankUrl}/${idWallet}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchGetBankListSucsess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchGetBankListError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchGetBankListError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchGetBankListError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getBankListReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetBankListReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,39 @@
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import {store} from "../redux/store";
|
import {store} from "../redux/store";
|
||||||
import { envoieUserWalletToWallet, envoieCommissionUrl } from "./IlinkConstants";
|
import {envoieCommissionUrl, envoieUserWalletToWallet} from "./IlinkConstants";
|
||||||
import { fetchEnvoieUserWalletToWalletPending, fetchEnvoieUserWalletToWalletSuccess, fetchEnvoieUserWalletToWalletError, fetchEnvoieUserWalletToCardGetCommissionError, fetchEnvoieUserWalletToWalletReset, fetchEnvoieUserWalletToWalleGetCommissiontPending, fetchEnvoieUserWalletToWalleGetCommissiontReset, fetchEnvoieUserWalletToWalletGetCommissionSuccess, fetchEnvoieUserWalletToWalletGetCommissionError, fetchEnvoieUserWalletToCashPending, fetchEnvoieUserWalletToCashSuccess, fetchEnvoieUserWalletToCashError, fetchEnvoieUserWalletToCashReset, fetchEnvoieUserWalletToCashGetCommissiontPending, fetchEnvoieUserWalletToCashGetCommissiontReset, fetchEnvoieUserWalletToCashGetCommissionError, fetchEnvoieUserWalletToCashGetCommissionSuccess, fetchEnvoieUserWalletToCardPending, fetchEnvoieUserWalletToCardSuccess, fetchEnvoieUserWalletToCardError, fetchEnvoieUserWalletToCardReset, fetchEnvoieUserWalletToCardGetCommissiontPending, fetchEnvoieUserWalletToCardGetCommissionSuccess, fetchEnvoieUserWalletToCardGetCommissiontReset } from "../redux/actions/EnvoieUserType";
|
import {
|
||||||
|
fetchEnvoieUserWalletToCardError,
|
||||||
|
fetchEnvoieUserWalletToCardGetCommissionError,
|
||||||
|
fetchEnvoieUserWalletToCardGetCommissionSuccess,
|
||||||
|
fetchEnvoieUserWalletToCardGetCommissiontPending,
|
||||||
|
fetchEnvoieUserWalletToCardGetCommissiontReset,
|
||||||
|
fetchEnvoieUserWalletToCardPending,
|
||||||
|
fetchEnvoieUserWalletToCardReset,
|
||||||
|
fetchEnvoieUserWalletToCardSuccess,
|
||||||
|
fetchEnvoieUserWalletToCashError,
|
||||||
|
fetchEnvoieUserWalletToCashGetCommissionError,
|
||||||
|
fetchEnvoieUserWalletToCashGetCommissionSuccess,
|
||||||
|
fetchEnvoieUserWalletToCashGetCommissiontPending,
|
||||||
|
fetchEnvoieUserWalletToCashGetCommissiontReset,
|
||||||
|
fetchEnvoieUserWalletToCashPending,
|
||||||
|
fetchEnvoieUserWalletToCashReset,
|
||||||
|
fetchEnvoieUserWalletToCashSuccess,
|
||||||
|
fetchEnvoieUserWalletToWalleGetCommissiontPending,
|
||||||
|
fetchEnvoieUserWalletToWalleGetCommissiontReset,
|
||||||
|
fetchEnvoieUserWalletToWalletError,
|
||||||
|
fetchEnvoieUserWalletToWalletGetCommissionError,
|
||||||
|
fetchEnvoieUserWalletToWalletGetCommissionSuccess,
|
||||||
|
fetchEnvoieUserWalletToWalletPending,
|
||||||
|
fetchEnvoieUserWalletToWalletReset,
|
||||||
|
fetchEnvoieUserWalletToWalletSuccess
|
||||||
|
} from "../redux/actions/EnvoieUserType";
|
||||||
|
import {
|
||||||
|
fetchEnvoieWalletToBankUserError,
|
||||||
|
fetchEnvoieWalletToBankUserPending,
|
||||||
|
fetchEnvoieWalletToBankUserReset,
|
||||||
|
fetchEnvoieWalletToBankUserSucsess
|
||||||
|
} from "../redux/actions/BankAction";
|
||||||
|
|
||||||
export const envoieUserWalletToWalletAction = (data) => {
|
export const envoieUserWalletToWalletAction = (data) => {
|
||||||
|
|
||||||
|
|
@ -241,3 +271,41 @@ export const getCommissionUserWalletToCardReset = () => {
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissiontReset());
|
dispatch(fetchEnvoieUserWalletToCardGetCommissiontReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const envoieUserWalletToBankAction = (data) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchEnvoieWalletToBankUserPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${envoieUserWalletToWallet}`,
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchEnvoieWalletToBankUserSucsess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchEnvoieWalletToBankUserError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchEnvoieWalletToBankUserError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchEnvoieWalletToBankUserError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const envoieUserWalletToBankReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchEnvoieWalletToBankUserReset());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -69,7 +69,7 @@ export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCre
|
||||||
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
||||||
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
||||||
export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history';
|
export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history';
|
||||||
export const getSuperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_super_history';
|
export const getBankUrl = testBaseUrl + '/walletService/wallets/users/banks';
|
||||||
|
|
||||||
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
export const authKeyUrl = testBaseUrl + '/oauth/token';
|
||||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue