Bank operation OK

This commit is contained in:
Brice 2020-11-04 21:02:23 +01:00
parent e18dae1f0a
commit bae9ae54f4
38 changed files with 7572 additions and 6451 deletions

12
App.js
View File

@ -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

View File

@ -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",

View File

@ -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",

View File

@ -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
});

View File

@ -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;
}
}
};

View File

@ -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;
}
}
};

View File

@ -1,5 +1,5 @@
import { AsyncStorage } from "react-native"; import {AsyncStorage} from "react-native";
import { persistCombineReducers } from "redux-persist"; import {persistCombineReducers} from "redux-persist";
import ActiveCountryListReducer from "./ActiveCountryListReducer"; import ActiveCountryListReducer from "./ActiveCountryListReducer";
import AskNanoCreditReducer from "./AskNanoCreditReducer"; import AskNanoCreditReducer from "./AskNanoCreditReducer";
import authKeyReducer from "./AuthKeyReducer"; import authKeyReducer from "./AuthKeyReducer";
@ -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;

4
redux/types/BankType.js Normal file
View File

@ -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';

View File

@ -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';

View File

@ -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",

View File

@ -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>

File diff suppressed because it is too large Load Diff

View File

@ -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 }}>

View File

@ -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 }}>

View File

@ -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 }}>

View File

@ -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>

View File

@ -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({

View File

@ -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>
} }

View File

@ -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");
}) })
} }

View File

@ -1,17 +1,33 @@
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';
import { Color } from '../../config/Color'; 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,24 +37,40 @@ 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});
}
}
});
} }
updateLangue() { updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') }) this.props.navigation.setParams({name: I18n.t('WALLET')})
this.forceUpdate(); this.forceUpdate();
} }
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({navigation}) => ({
header: null, header: null,
headerMode: 'none', headerMode: 'none',
headerTitle: null, headerTitle: null,
activeColor: '#f0edf6', activeColor: '#f0edf6',
inactiveColor: '#3e2465', inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' }, barStyle: {backgroundColor: '#694fad'},
drawerLabel: I18n.t('CREDIT_MANAGE'), drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'credit-card'} name={'credit-card'}
size={24} size={24}
@ -53,19 +85,104 @@ 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
key={index} key={index}
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]} style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
onPress={() => { onPress={() => {
}}> }}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}> <View style={{flexDirection: 'row', alignItems: 'center'}}>
<View style={styles.iconContent}> <View style={styles.iconContent}>
<Image style={{ width: 48, height: 48 }} source={{ uri: item.icon }} /> <Image style={{width: 48, height: 48}} source={{uri: item.icon}}/>
</View> </View>
<View> <View>
<Text style={Typography.body1}>{item.title}</Text> <Text style={Typography.body1}>{item.title}</Text>
@ -79,23 +196,25 @@ export default class OperateurOptionSelect extends Component {
renderList = () => { renderList = () => {
const { options } = this.state; const {options} = this.state;
return ( return (
<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}}>
<StatusBar <StatusBar
backgroundColor={Color.primaryDarkColor} backgroundColor={Color.primaryDarkColor}
@ -103,45 +222,30 @@ export default class OperateurOptionSelect extends Component {
translucent={false} translucent={false}
/> />
<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: {
@ -207,7 +323,7 @@ const styles = StyleSheet.create({
shadowColor: Color.borderColor, shadowColor: Color.borderColor,
borderColor: Color.borderColor, borderColor: Color.borderColor,
borderWidth: 0.5, borderWidth: 0.5,
shadowOffset: { width: 1.5, height: 1.5 }, shadowOffset: {width: 1.5, height: 1.5},
shadowOpacity: 1.0, shadowOpacity: 1.0,
elevation: 5, elevation: 5,
borderRadius: 10, borderRadius: 10,

View File

@ -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>

View File

@ -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>
)) ))

View File

@ -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 {Color} from '../../config/Color';
import CustomButton from '../../components/CustomButton';
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 {
import { getWalletTransactionHistoryUser, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi'; getWalletTransactionHistoryReset,
import { getUserIdentificationAction, getUserIdentificationResetAction } from '../../webservice/IdentificationApi'; getWalletTransactionHistoryUser
import { transferCommissionAction } from '../../webservice/WalletTransferCommission'; } from '../../webservice/WalletTransactionHistoryApi';
import { resetCommissionReducer } from '../../webservice/WalletTransferCommission'; import {getUserIdentificationAction, getUserIdentificationResetAction} from '../../webservice/IdentificationApi';
import {resetCommissionReducer, transferCommissionAction} 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'
@ -32,11 +40,24 @@ import 'moment/locale/en-ie'
import 'moment/locale/en-il' import 'moment/locale/en-il'
import 'moment/locale/en-nz' 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');
@ -64,7 +85,7 @@ class WalletDetailUser extends Component {
}; };
slugify.extend({ '+': 'plus' }); slugify.extend({'+': 'plus'});
this.scrollY = new Animated.Value(0); this.scrollY = new Animated.Value(0);
this.scrollHeaderY = new Animated.Value(0); this.scrollHeaderY = new Animated.Value(0);
@ -88,7 +109,7 @@ class WalletDetailUser extends Component {
readUser().then((user) => { readUser().then((user) => {
if (user) { if (user) {
if (user !== undefined) { if (user !== undefined) {
this.setState({ user }); this.setState({user});
this.props.getUserIdentificationAction(user.phone); this.props.getUserIdentificationAction(user.phone);
this.props.getWalletTransactionHistoryUser(user.id); this.props.getWalletTransactionHistoryUser(user.id);
} }
@ -124,7 +145,7 @@ class WalletDetailUser extends Component {
}; };
componentDidMount() { componentDidMount() {
const { result, resultUserIdentification, errorUserIdentification } = this.props; const {result, resultUserIdentification, errorUserIdentification} = this.props;
if (result !== null) { if (result !== null) {
if (typeof result.response !== 'undefined') { if (typeof result.response !== 'undefined') {
@ -160,7 +181,7 @@ class WalletDetailUser extends Component {
} }
getWalletIcon = (wallet) => { getWalletIcon = (wallet) => {
return `${baseUrl}/datas/img/network/${slugify(wallet.network, { lower: true })}-logo.png`; return `${baseUrl}/datas/img/network/${slugify(wallet.network, {lower: true})}-logo.png`;
} }
@ -170,11 +191,11 @@ class WalletDetailUser extends Component {
} }
updateLangue() { updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') }) this.props.navigation.setParams({name: I18n.t('WALLET')})
this.forceUpdate() this.forceUpdate()
} }
handleIndexChange = index => this.setState({ index }); handleIndexChange = index => this.setState({index});
imageScale = () => { imageScale = () => {
return this.scrollY.interpolate({ return this.scrollY.interpolate({
@ -227,7 +248,7 @@ class WalletDetailUser extends Component {
justifyContent: 'flex-end', justifyContent: 'flex-end',
}}> }}>
<Animated.Image <Animated.Image
source={{ uri: this.getWalletIcon(wallet) }} source={{uri: this.getWalletIcon(wallet)}}
style={{ style={{
width: 120, width: 120,
height: 120, height: 120,
@ -242,7 +263,7 @@ class WalletDetailUser extends Component {
{ {
translateY: this.imageTranslateY() translateY: this.imageTranslateY()
}] }]
}} /> }}/>
<View style={{ <View style={{
marginTop: 1, flex: 1, marginTop: 1, flex: 1,
@ -250,17 +271,24 @@ class WalletDetailUser extends Component {
justifyContent: 'flex-end' justifyContent: 'flex-end'
}}> }}>
<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);
}}> }}>
&nbsp;{I18n.t('LINK_CARD')} &nbsp;{I18n.t('LINK_CARD')}
</Tag> </Tag>
<Tag icon={<Icon name='update' size={20} color={Color.whiteColor} />} primary <Tag icon={<Icon name='update' size={20} color={Color.whiteColor}/>} primary
style={{ width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0, }}> style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}>
&nbsp;&nbsp;{I18n.t('HISTORY')} &nbsp;&nbsp;{I18n.t('HISTORY')}
</Tag> </Tag>
@ -268,25 +296,27 @@ 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>
); );
renderLoader = () => { renderLoader = () => {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android' {Platform.OS === 'android'
? ?
( (
<> <>
<ProgressBarAndroid /> <ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
) : ) :
<> <>
<ActivityIndicator size="large" color={'#ccc'} /> <ActivityIndicator size="large" color={'#ccc'}/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
} }
@ -295,7 +325,7 @@ class WalletDetailUser extends Component {
} }
renderAccountDetail = (wallet) => ( renderAccountDetail = (wallet) => (
<View style={{ flexDirection: 'row', flex: 1, justifyContent: 'space-between' }}> <View style={{flexDirection: 'row', flex: 1, justifyContent: 'space-between'}}>
<View <View
style={{ style={{
@ -305,7 +335,7 @@ class WalletDetailUser extends Component {
<View <View
style={[ style={[
styles.circlePoint, styles.circlePoint,
{ backgroundColor: Color.primaryColor }, {backgroundColor: Color.primaryColor},
]}> ]}>
<Icons name='md-wallet' <Icons name='md-wallet'
size={28} size={28}
@ -313,10 +343,11 @@ class WalletDetailUser extends Component {
/> />
</View> </View>
<View> <View>
<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>
@ -328,7 +359,7 @@ class WalletDetailUser extends Component {
<View <View
style={[ style={[
styles.circlePoint, styles.circlePoint,
{ backgroundColor: Color.primaryColor }, {backgroundColor: Color.primaryColor},
]}> ]}>
<Icons name='md-key' <Icons name='md-key'
size={28} size={28}
@ -336,7 +367,7 @@ class WalletDetailUser extends Component {
/> />
</View> </View>
<View> <View>
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 3 }}> <Text style={[Typography.title3, Color.primaryColor], {marginBottom: 3}}>
{I18n.t('NUMERO_COMPTE')} {I18n.t('NUMERO_COMPTE')}
</Text> </Text>
<Text style={[Typography.body2]}>{wallet.user_code}</Text> <Text style={[Typography.body2]}>{wallet.user_code}</Text>
@ -361,7 +392,7 @@ class WalletDetailUser extends Component {
zIndex: 1, zIndex: 1,
backgroundColor: Color.primaryColor, backgroundColor: Color.primaryColor,
height: 140 - this.state.scrollHeaderY, height: 140 - this.state.scrollHeaderY,
}} /> }}/>
<ScrollView ref={component => this._scrollView = component} <ScrollView ref={component => this._scrollView = component}
style={{ style={{
@ -374,22 +405,26 @@ class WalletDetailUser extends Component {
onScroll={Animated.event([ onScroll={Animated.event([
{ {
nativeEvent: { nativeEvent: {
contentOffset: { y: this.scrollY }, contentOffset: {y: this.scrollY},
}, },
}, },
], ],
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}> {
<View style={{ marginTop: 80, }}> listener: (event) => {
this.setState({scrollHeaderY: event.nativeEvent.contentOffset.y});
}
})}>
<View style={{marginTop: 80,}}>
{this.renderHeader(wallet)} {this.renderHeader(wallet)}
<View <View
style={[styles.blockView, { borderBottomColor: Color.borderColor }]}> style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
{this.renderAccountDetail(wallet)} {this.renderAccountDetail(wallet)}
<> <>
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}> <View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
<Text <Text
style={[Typography.title3, Typography.semibold]}> style={[Typography.title3, Typography.semibold]}>
{I18n.t('TRANSACTIONS')} {I18n.t('TRANSACTIONS')}
@ -414,7 +449,7 @@ class WalletDetailUser extends Component {
<Icon name='arrow-bottom-right' <Icon name='arrow-bottom-right'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner} /> style={styles.imageBanner}/>
<View style={[styles.content]}> <View style={[styles.content]}>
@ -452,7 +487,7 @@ class WalletDetailUser extends Component {
<Icon name='arrow-top-left' <Icon name='arrow-top-left'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner} /> style={styles.imageBanner}/>
<View style={[styles.content]}> <View style={[styles.content]}>
@ -496,15 +531,16 @@ class WalletDetailUser extends Component {
<Icon name='cash-multiple' <Icon name='cash-multiple'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner} /> style={styles.imageBanner}/>
<View style={[styles.content]}> <View style={[styles.content]}>
<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>
@ -522,10 +558,10 @@ class WalletDetailUser extends Component {
<Icon name='heart-multiple' <Icon name='heart-multiple'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner} /> style={styles.imageBanner}/>
<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_SANTE')} {I18n.t('NANO_SANTE')}
</Text> </Text>
@ -556,7 +592,7 @@ class WalletDetailUser extends Component {
<Icon name='file-document' <Icon name='file-document'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner} /> style={styles.imageBanner}/>
<View style={[styles.content]}> <View style={[styles.content]}>
@ -566,8 +602,10 @@ class WalletDetailUser extends Component {
</Text> </Text>
</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>
@ -599,18 +637,20 @@ class WalletDetailUser extends Component {
<Icon name='pencil-plus' <Icon name='pencil-plus'
color={Color.primaryColor} color={Color.primaryColor}
size={30} size={30}
style={styles.imageBanner} /> style={styles.imageBanner}/>
<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('CREATION_IDENTIFICATION_CLIENT')} {I18n.t('CREATION_IDENTIFICATION_CLIENT')}
</Text> </Text>
</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>
@ -629,7 +669,7 @@ class WalletDetailUser extends Component {
</>) </>)
: :
( (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text> <Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
</View> </View>
) )
@ -638,110 +678,122 @@ class WalletDetailUser extends Component {
} }
renderModalHistoryDetail = () => { renderModalHistoryDetail = () => {
const { historyItemDetail } = this.state; const {historyItemDetail} = this.state;
return ( return (
<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}]}>
<View style={{ flexDirection: 'row', marginTop: 10 }}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<Text style={[styles.body2]}>{I18n.t('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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text> <Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
</View> </View>
<View style={{ flex: 1, alignItems: 'flex-end' }}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<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>
@ -753,7 +805,7 @@ class WalletDetailUser extends Component {
displayModalHistory: !this.state.displayModalHistory, displayModalHistory: !this.state.displayModalHistory,
}); });
}} /> }}/>
</Dialog.Container> </Dialog.Container>
@ -763,11 +815,13 @@ 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}>
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}> <Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
{ {
isEqual(element, 'montant') ? isEqual(element, 'montant') ?
`${thousands(item[element], ' ')}` `${thousands(item[element], ' ')}`
@ -804,18 +858,17 @@ class WalletDetailUser extends Component {
} }
renderHistoryTransactionList = (wallet) => { renderHistoryTransactionList = (wallet) => {
const { resultTransaction, errorTransaction } = this.props; const {resultTransaction, errorTransaction} = this.props;
if (errorTransaction !== null) { if (errorTransaction !== null) {
if (typeof errorTransaction.data !== 'undefined') { if (typeof errorTransaction.data !== 'undefined') {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<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>
</View> </View>
) )
@ -828,13 +881,13 @@ class WalletDetailUser extends Component {
Array.isArray(resultTransaction.response) && (resultTransaction.response.length) > 0 ? Array.isArray(resultTransaction.response) && (resultTransaction.response.length) > 0 ?
( (
<> <>
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}> <View style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
{ {
transactionHistoryIlinkLabel().map((item, index) => ( transactionHistoryIlinkLabel().map((item, index) => (
<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>
)) ))
@ -848,7 +901,7 @@ class WalletDetailUser extends Component {
</> </>
) : ) :
( (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-start' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'flex-start'}}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_HISTORY')}</Text> <Text style={Typography.body1}>{I18n.t('NO_WALLET_HISTORY')}</Text>
</View> </View>
) )
@ -865,25 +918,25 @@ class WalletDetailUser extends Component {
{ {
this.props.loadingTransaction ? this.props.loadingTransaction ?
( (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android' {Platform.OS === 'android'
? ?
( (
<> <>
<ProgressBarAndroid /> <ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
) : ) :
<> <>
<ActivityIndicator size="large" color={'#ccc'} /> <ActivityIndicator size="large" color={'#ccc'}/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
} }
</View> </View>
) : ) :
<> <>
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}> <View style={[styles.checkDefault, {borderBottomColor: Color.borderColor}]}>
<Text <Text
style={[Typography.title3, Typography.semibold]}> style={[Typography.title3, Typography.semibold]}>
{I18n.t('TRANSACTION_HISTORY')} {I18n.t('TRANSACTION_HISTORY')}
@ -916,7 +969,7 @@ class WalletDetailUser extends Component {
Array.isArray(this.props.result.response) && (this.props.result.response.length) === 0 ? Array.isArray(this.props.result.response) && (this.props.result.response.length) === 0 ?
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text> <Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
</View> </View>
: :
@ -987,15 +1040,11 @@ 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,
borderWidth: 0.5, borderWidth: 0.5,
shadowOffset: { width: 1.5, height: 1.5 }, shadowOffset: {width: 1.5, height: 1.5},
shadowOpacity: 1.0, shadowOpacity: 1.0,
elevation: 5, elevation: 5,
flexDirection: "row", flexDirection: "row",
@ -1023,7 +1072,7 @@ const styles = StyleSheet.create({
paddingRight: 10, paddingRight: 10,
alignItems: "center" alignItems: "center"
}, },
tagFollow: { width: 150, margin: 10 }, tagFollow: {width: 150, margin: 10},
profileItem: { profileItem: {
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between",
@ -1067,7 +1116,7 @@ const styles = StyleSheet.create({
shadowColor: Color.borderColor, shadowColor: Color.borderColor,
borderColor: Color.borderColor, borderColor: Color.borderColor,
borderWidth: 0.5, borderWidth: 0.5,
shadowOffset: { width: 1.5, height: 1.5 }, shadowOffset: {width: 1.5, height: 1.5},
shadowOpacity: 1.0, shadowOpacity: 1.0,
elevation: 5, elevation: 5,
borderRadius: 10, borderRadius: 10,

View File

@ -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>

View File

@ -1,26 +1,36 @@
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';
import I18n from 'react-native-i18n'
import {Color} from '../../config/Color';
import {baseUrl} from '../../webservice/IlinkConstants';
import {IlinkEmitter} from "../../utils/events";
import {Appbar, Provider} from 'react-native-paper';
import {getWalletActivated} from '../../webservice/WalletApi';
import {connect} from 'react-redux';
import {readUser} from '../../webservice/AuthApi';
import {bindActionCreators} from 'redux';
import {Typography} from '../../config/typography';
const route = require('./../../route.json'); const route = require('./../../route.json');
let slugify = require('slugify'); let slugify = require('slugify');
import I18n from 'react-native-i18n'
import * as Utils from '../../utils/DeviceUtils';
import { Images } from '../../config/Images';
import { Color } from '../../config/Color';
import { baseUrl } from '../../webservice/IlinkConstants';
import { IlinkEmitter } from "../../utils/events";
import { Provider, Appbar } from 'react-native-paper';
import { getWalletActivated } from '../../webservice/WalletApi';
import { connect } from 'react-redux';
import { readUser } from '../../webservice/AuthApi';
import { bindActionCreators } from 'redux';
import { FontWeight, Typography } from '../../config/typography';
class WalletSelect extends Component { class WalletSelect extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
slugify.extend({ '+': 'plus' }); slugify.extend({'+': 'plus'});
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)); IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
this.state = { this.state = {
result: null, result: null,
@ -30,15 +40,15 @@ class WalletSelect extends Component {
} }
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({navigation}) => ({
header: null, header: null,
headerMode: 'none', headerMode: 'none',
headerTitle: null, headerTitle: null,
activeColor: '#f0edf6', activeColor: '#f0edf6',
inactiveColor: '#3e2465', inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' }, barStyle: {backgroundColor: '#694fad'},
drawerLabel: I18n.t('CREDIT_MANAGE'), drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'credit-card'} name={'credit-card'}
size={24} size={24}
@ -52,7 +62,7 @@ class WalletSelect extends Component {
if (user !== undefined) { if (user !== undefined) {
if (user.phone !== undefined) { if (user.phone !== undefined) {
this.props.getWalletActivated(user.agentId); this.props.getWalletActivated(user.agentId);
this.setState({ agentId: user.agentId }); this.setState({agentId: user.agentId});
} }
} }
} }
@ -74,24 +84,24 @@ class WalletSelect extends Component {
} */ } */
updateLangue() { updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') }) this.props.navigation.setParams({name: I18n.t('WALLET')})
this.forceUpdate() this.forceUpdate()
} }
renderLoader = () => { renderLoader = () => {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android' {Platform.OS === 'android'
? ?
( (
<> <>
<ProgressBarAndroid /> <ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
) : ) :
<> <>
<ActivityIndicator size="large" color={'#ccc'} /> <ActivityIndicator size="large" color={'#ccc'}/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
} }
@ -100,25 +110,25 @@ class WalletSelect extends Component {
} }
renderWalletItem = (item) => { renderWalletItem = (item) => {
let icon = `${baseUrl}/datas/img/network/${slugify(item.network, { lower: true })}-logo.png`; let icon = `${baseUrl}/datas/img/network/${slugify(item.network, {lower: true})}-logo.png`;
let itemToSend = item; let itemToSend = item;
itemToSend.agentId = this.state.agentId; itemToSend.agentId = this.state.agentId;
return ( return (
<TouchableOpacity <TouchableOpacity
key={item.id} key={item.id}
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]} style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
onPress={() => this.props.navigation.navigate('walletDetail', { onPress={() => this.props.navigation.navigate('walletDetail', {
wallet: itemToSend,/* wallet: itemToSend,/*
onRefreshDetail: () => this.refresh() */ onRefreshDetail: () => this.refresh() */
})}> })}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}> <View style={{flexDirection: 'row', alignItems: 'center'}}>
<View style={styles.iconContent}> <View style={styles.iconContent}>
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} /> <Image style={{width: 48, height: 48}} source={{uri: icon}}/>
</View> </View>
<View> <View>
<Text style={Typography.body1}>{item.network}</Text> <Text style={Typography.body1}>{item.network}</Text>
<Text style={[Typography.footnote, Color.grayColor]} style={{ marginTop: 5 }}> <Text style={[Typography.footnote, Color.grayColor]} style={{marginTop: 5}}>
{I18n.t('COUNTRY')}: {item.country} {I18n.t('COUNTRY')}: {item.country}
</Text> </Text>
</View> </View>
@ -129,18 +139,17 @@ class WalletSelect extends Component {
renderWalletList = () => { renderWalletList = () => {
const { result, error } = this.props; const {result, error} = this.props;
if (error !== null) { if (error !== null) {
if (typeof error.data !== 'undefined') { if (typeof error.data !== 'undefined') {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<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>
</View> </View>
) )
@ -150,7 +159,7 @@ class WalletSelect extends Component {
if (result.response !== null) { if (result.response !== null) {
return ( return (
Array.isArray(result.response) && (result.response.length) > 0 ? Array.isArray(result.response) && (result.response.length) > 0 ?
(<ScrollView style={{ flex: 1, padding: 20 }}> (<ScrollView style={{flex: 1, padding: 20}}>
{ {
result.response.map((item) => ( result.response.map((item) => (
this.renderWalletItem(item) this.renderWalletItem(item)
@ -158,7 +167,7 @@ class WalletSelect extends Component {
} }
</ScrollView>) : </ScrollView>) :
( (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text> <Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
</View> </View>
) )
@ -172,7 +181,7 @@ class WalletSelect extends Component {
console.log("WALLET PROPS", this.props); console.log("WALLET PROPS", this.props);
return ( return (
<Provider> <Provider>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<StatusBar <StatusBar
backgroundColor={Color.primaryDarkColor} backgroundColor={Color.primaryDarkColor}
@ -180,9 +189,11 @@ class WalletSelect extends Component {
translucent={false} translucent={false}
/> />
<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')}

View File

@ -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>

View File

@ -1,27 +1,40 @@
import Button from 'apsl-react-native-button'; import Button from 'apsl-react-native-button';
import isEqual from 'lodash/isEqual'; import isEqual from 'lodash/isEqual';
import isNil from 'lodash/isNil'; import isNil from 'lodash/isNil';
import React, { Component } from 'react'; import React, {Component} from 'react';
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native'; import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import I18n from 'react-native-i18n'; import I18n from 'react-native-i18n';
import Dialog from "react-native-dialog"; import Dialog from "react-native-dialog";
import { Dropdown } from 'react-native-material-dropdown'; import {Dropdown} from 'react-native-material-dropdown';
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions'; import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import { ProgressDialog } from 'react-native-simple-dialogs'; import {ProgressDialog} from 'react-native-simple-dialogs';
import { Fumi } from 'react-native-textinput-effects'; import {Fumi} from 'react-native-textinput-effects';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { bindActionCreators } from 'redux'; import {bindActionCreators} from 'redux';
import { Color } from '../../../config/Color'; import {Color} from '../../../config/Color';
import { store } from "../../../redux/store"; import {store} from "../../../redux/store";
import { identityPieces, isIlinkWorldWallet, isNormalInteger, typeIdIDestinataire, thousandsSeparators } from '../../../utils/UtilsFunction'; import {identityPieces, isNormalInteger} from '../../../utils/UtilsFunction';
import { readUser } from '../../../webservice/AuthApi'; import {readUser} from '../../../webservice/AuthApi';
import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, 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,
@ -99,7 +111,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
readUser().then((user) => { readUser().then((user) => {
if (user) { if (user) {
if (user !== undefined) { if (user !== undefined) {
this.setState({ user }); this.setState({user});
} }
} }
}); });
@ -122,7 +134,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
renderGetActionCountryList = () => { renderGetActionCountryList = () => {
const { resultActiveCountryList, errorActiveCountryList } = this.props; const {resultActiveCountryList, errorActiveCountryList} = this.props;
if (resultActiveCountryList !== null) { if (resultActiveCountryList !== null) {
if (typeof resultActiveCountryList.response !== 'undefined') { if (typeof resultActiveCountryList.response !== 'undefined') {
@ -132,7 +144,10 @@ class 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
});
} }
} }
@ -149,7 +164,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} else { } else {
Alert.alert( Alert.alert(
@ -163,14 +178,14 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
} }
renderGetPayCountryNetworkResponse = () => { renderGetPayCountryNetworkResponse = () => {
const { resultPayCountryNetwork, errorPayCountryNetwork } = this.props; const {resultPayCountryNetwork, errorPayCountryNetwork} = this.props;
if (resultPayCountryNetwork !== null) { if (resultPayCountryNetwork !== null) {
if (typeof resultPayCountryNetwork.response !== 'undefined') { if (typeof resultPayCountryNetwork.response !== 'undefined') {
if (resultPayCountryNetwork.response.length > 0) { if (resultPayCountryNetwork.response.length > 0) {
@ -180,8 +195,7 @@ class 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: '',
@ -205,7 +219,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} else { } else {
Alert.alert( Alert.alert(
@ -219,7 +233,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
@ -227,7 +241,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
renderEnvoieWalletToWalletResponse = () => { renderEnvoieWalletToWalletResponse = () => {
const { resultEnvoieWalletToCash, errorEnvoieWalletToCash } = this.props; const {resultEnvoieWalletToCash, errorEnvoieWalletToCash} = this.props;
if (errorEnvoieWalletToCash !== null) { if (errorEnvoieWalletToCash !== null) {
if (typeof errorEnvoieWalletToCash.data !== 'undefined') { if (typeof errorEnvoieWalletToCash.data !== 'undefined') {
@ -241,7 +255,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
@ -261,7 +275,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
@ -269,7 +283,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
renderDialogGetCommissionResponse = () => { renderDialogGetCommissionResponse = () => {
const { errorEnvoieWalletToCashGetCommission } = this.props; const {errorEnvoieWalletToCashGetCommission} = this.props;
if (errorEnvoieWalletToCashGetCommission !== null) { if (errorEnvoieWalletToCashGetCommission !== null) {
if (typeof errorEnvoieWalletToCashGetCommission.data !== 'undefined') { if (typeof errorEnvoieWalletToCashGetCommission.data !== 'undefined') {
@ -283,7 +297,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
@ -295,7 +309,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
isMontantValid = () => { isMontantValid = () => {
const { montant } = this.state; const {montant} = this.state;
if ((parseInt(isEqual(montant, 0)) || montant < 0)) if ((parseInt(isEqual(montant, 0)) || montant < 0))
return { return {
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'), errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
@ -336,32 +350,35 @@ class EnvoieCashVersAutreWalletAgent extends Component {
<View> <View>
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}> <View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
<View style={{ flexDirection: 'row', marginTop: 10 }}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text> <Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
</View> </View>
<View style={{ flex: 1, alignItems: 'flex-end' }}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View> </View>
</View> </View>
<View style={{ flexDirection: 'row', marginTop: 10 }}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text> <Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
</View> </View>
<View style={{ flex: 1, alignItems: 'flex-end' }}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(commission, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View> </View>
</View> </View>
</View> </View>
<View style={{ paddingVertical: 10 }}> <View style={{paddingVertical: 10}}>
<View style={{ paddingVertical: 10 }}> <View style={{paddingVertical: 10}}>
<View style={{ flexDirection: 'row', marginTop: 10 }}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{ flex: 1 }}> <View style={{flex: 1}}>
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text> <Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
</View> </View>
<View style={{ flex: 1, alignItems: 'flex-end' }}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}`}</Text> <Text
style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net_final, ' ')}`}</Text>
</View> </View>
</View> </View>
</View> </View>
@ -372,7 +389,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
this.setState({ this.setState({
isModalConfirmVisible: false isModalConfirmVisible: false
}); });
}} /> }}/>
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => { <Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
this.setState({ this.setState({
isModalConfirmVisible: false, isModalConfirmVisible: false,
@ -397,7 +414,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
password: this.state.password password: this.state.password
}); });
this.props.getCommissionUserWalletToCashReset(); this.props.getCommissionUserWalletToCashReset();
}} /> }}/>
</Dialog.Container> </Dialog.Container>
@ -407,7 +424,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
onSubmitNextStep = () => { onSubmitNextStep = () => {
const { nomsEmetteur, prenomsEmetteur, emailEmetteur, numeroIdentiteEmetteur } = this.state; const {nomsEmetteur, prenomsEmetteur, emailEmetteur, numeroIdentiteEmetteur} = this.state;
if (this.ckeckIfFieldIsOK(nomsEmetteur)) if (this.ckeckIfFieldIsOK(nomsEmetteur))
this.nomsEmetteurAnim.shake(800); this.nomsEmetteurAnim.shake(800);
@ -434,7 +451,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
} }
onSubmitCashVersAutreWallet = () => { onSubmitCashVersAutreWallet = () => {
const { nomsDestinataire, prenomsDestinataire, montant, password, numeroIdentiteDestinataire } = this.state; const {nomsDestinataire, prenomsDestinataire, montant, password, numeroIdentiteDestinataire} = this.state;
if (this.ckeckIfFieldIsOK(nomsDestinataire)) if (this.ckeckIfFieldIsOK(nomsDestinataire))
this.nomDestinataireAnim.shake(800); this.nomDestinataireAnim.shake(800);
@ -445,8 +462,7 @@ class 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 {
@ -477,7 +493,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
render() { render() {
console.log("STATE", this.state); console.log("STATE", this.state);
const { resultEnvoieWalletToCashGetCommission } = this.props; const {resultEnvoieWalletToCashGetCommission} = this.props;
return ( return (
<> <>
{(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()} {(this.state.modalVisible || this.props.loadingEnvoieWalletToCashGetCommission || this.props.loadingEnvoieWalletToCash || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()}
@ -497,35 +513,41 @@ class 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'}
iconSize={20} iconSize={20}
value={this.state.nomsEmetteur} value={this.state.nomsEmetteur}
onChangeText={(nomsEmetteur) => { onChangeText={(nomsEmetteur) => {
this.setState({ nomsEmetteur }) this.setState({nomsEmetteur})
}} }}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.prenomsEmetteurAnim = comp }}> <Animatable.View ref={(comp) => {
this.prenomsEmetteurAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
label={`${I18n.t('FIRSTNAME_EMETTEUR')}`} label={`${I18n.t('FIRSTNAME_EMETTEUR')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
value={this.state.prenomsEmetteur} value={this.state.prenomsEmetteur}
onChangeText={(prenomsEmetteur) => { onChangeText={(prenomsEmetteur) => {
this.setState({ prenomsEmetteur }) this.setState({prenomsEmetteur})
}} }}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.emailEmetteurAnim = comp }}> <Animatable.View ref={(comp) => {
this.emailEmetteurAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName='envelope' <Fumi iconClass={FontAwesomeIcon} iconName='envelope'
label={I18n.t('EMAIL_EMETTEUR')} label={I18n.t('EMAIL_EMETTEUR')}
iconColor={'#f95a25'} iconColor={'#f95a25'}
@ -533,14 +555,16 @@ class EnvoieCashVersAutreWalletAgent extends Component {
iconSize={20} iconSize={20}
value={this.state.emailEmetteur} value={this.state.emailEmetteur}
onChangeText={(emailEmetteur) => { onChangeText={(emailEmetteur) => {
this.setState({ emailEmetteur }) this.setState({emailEmetteur})
}} }}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.identityPiecesEmetteurAnim = comp }} <Animatable.View ref={(comp) => {
this.identityPiecesEmetteurAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -557,20 +581,26 @@ class EnvoieCashVersAutreWalletAgent extends Component {
useNativeDriver={true} useNativeDriver={true}
value={this.state.identityPiecesNameEmetteur} value={this.state.identityPiecesNameEmetteur}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false }); this.setState({identityPiecesNameEmetteur: value, isDataSubmit: false});
}}
valueExtractor={(value) => {
return I18n.t(value.name)
}}
labelExtractor={(value) => {
return I18n.t(value.name)
}} }}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
/> />
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.numeroIdentiteEmetteurAnim = comp }}> <Animatable.View ref={(comp) => {
this.numeroIdentiteEmetteurAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'address-card'} <Fumi iconClass={FontAwesomeIcon} iconName={'address-card'}
label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`} label={`${I18n.t('NUMERO_IDENTITE_EMETTEUR')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
onChangeText={(numeroIdentiteEmetteur) => { onChangeText={(numeroIdentiteEmetteur) => {
this.setState({ numeroIdentiteEmetteur }) this.setState({numeroIdentiteEmetteur})
}} }}
style={styles.input} style={styles.input}
> >
@ -580,56 +610,66 @@ class 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'}
iconSize={20} iconSize={20}
value={this.state.nomsDestinataire} value={this.state.nomsDestinataire}
onChangeText={(nomsDestinataire) => { onChangeText={(nomsDestinataire) => {
this.setState({ nomsDestinataire }) this.setState({nomsDestinataire})
}} }}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.prenomsDestinataireAnim = comp }}> <Animatable.View ref={(comp) => {
this.prenomsDestinataireAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`} label={`${I18n.t('FIRSTNAME_DESTINATAIRE')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
value={this.state.prenomsDestinataire} value={this.state.prenomsDestinataire}
onChangeText={(prenomsDestinataire) => { onChangeText={(prenomsDestinataire) => {
this.setState({ prenomsDestinataire }) this.setState({prenomsDestinataire})
}} }}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.identityPiecesDestinataireAnim = comp }}> <Animatable.View ref={(comp) => {
this.identityPiecesDestinataireAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'} <Fumi iconClass={FontAwesomeIcon} iconName={'user-circle-o'}
label={`${I18n.t('ID_DESTINATAIRE')}`} label={`${I18n.t('ID_DESTINATAIRE')}`}
iconColor={'#f95a25'} iconColor={'#f95a25'}
iconSize={20} iconSize={20}
value={this.state.numeroIdentiteDestinataire} value={this.state.numeroIdentiteDestinataire}
onChangeText={(numeroIdentiteDestinataire) => { onChangeText={(numeroIdentiteDestinataire) => {
this.setState({ numeroIdentiteDestinataire }) this.setState({numeroIdentiteDestinataire})
}} }}
style={styles.input} style={styles.input}
> >
</Fumi> </Fumi>
</Animatable.View> </Animatable.View>
<Animatable.View ref={(comp) => { this.paysDestinationAnim = comp }} <Animatable.View ref={(comp) => {
this.paysDestinationAnim = comp
}}
style={{ style={{
width: responsiveWidth(90), width: responsiveWidth(90),
height: 60, height: 60,
@ -649,17 +689,30 @@ class 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'}
@ -695,7 +754,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
iconSize={20} iconSize={20}
value={this.state.montant} value={this.state.montant}
onChangeText={(montant) => { onChangeText={(montant) => {
this.setState({ montant }) this.setState({montant})
}} }}
style={styles.input} style={styles.input}
> >
@ -717,11 +776,14 @@ class 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'}
@ -729,7 +791,7 @@ class EnvoieCashVersAutreWalletAgent extends Component {
secureTextEntry={true} secureTextEntry={true}
value={this.state.password} value={this.state.password}
onChangeText={(password) => { onChangeText={(password) => {
this.setState({ password }) this.setState({password})
}} }}
style={styles.input} style={styles.input}
> >
@ -738,7 +800,9 @@ class 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>
</> </>

View File

@ -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,
}
});

View File

@ -1,25 +1,24 @@
import Button from 'apsl-react-native-button'; import Button from 'apsl-react-native-button';
import isEqual from 'lodash/isEqual'; import isEqual from 'lodash/isEqual';
import isNil from 'lodash/isNil'; import isNil from 'lodash/isNil';
import React, { Component } from 'react'; import React, {Component} from 'react';
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native'; import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
import * as Animatable from 'react-native-animatable'; import * as Animatable from 'react-native-animatable';
import 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';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; 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 {envoieUserWalletToBankAction, envoieUserWalletToBankReset} from '../../../webservice/EnvoieUserApi';
import { envoieUserWalletToCardAction, envoieUserWalletToCardReset, getCommissionUserWalletToCardAction, getCommissionUserWalletToCardReset } 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();
} }
@ -76,7 +75,7 @@ class EnvoieWalletToBankUser extends Component {
readUser().then((user) => { readUser().then((user) => {
if (user) { if (user) {
if (user !== undefined) { if (user !== undefined) {
this.setState({ user }); this.setState({user});
} }
} }
}); });
@ -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,52 +95,52 @@ 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();
} }
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
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();
} }
} }
], ],
{ cancelable: false } {cancelable: false}
) )
} }
} }
} }
renderDialogGetCommissionResponse = () => { /* renderDialogGetCommissionResponse = () => {
const { errorEnvoieWalletToCardGetCommission } = this.props; const { errorEnvoieWalletToCardGetCommission } = this.props;
@ -162,14 +161,15 @@ class EnvoieWalletToBankUser extends Component {
} }
} }
} }*/
updateLangue() { updateLangue() {
this.props.navigation.setParams({ name: I18n.t('DEPOSIT_TO_CARD') }) this.props.navigation.setParams({name: I18n.t('DEPOSIT_TO_CARD')})
this.forceUpdate() this.forceUpdate()
} }
/*
modalConfirmTransaction = (data) => { modalConfirmTransaction = (data) => {
const frais = data.response.frais; const frais = data.response.frais;
@ -238,13 +238,14 @@ class EnvoieWalletToBankUser extends Component {
); );
} }
*/
ckeckIfFieldIsOK(champ) { ckeckIfFieldIsOK(champ) {
return (isNil(champ) || isEqual(champ.length, 0)); return (isNil(champ) || isEqual(champ.length, 0));
} }
isMontantValid = () => { isMontantValid = () => {
const { montant } = this.state; const {montant} = this.state;
if ((parseInt(isEqual(montant, 0)) || montant < 0)) if ((parseInt(isEqual(montant, 0)) || montant < 0))
return { return {
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'), errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
@ -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'}
@ -338,7 +343,7 @@ class EnvoieWalletToBankUser extends Component {
iconSize={20} iconSize={20}
value={this.state.montant} value={this.state.montant}
onChangeText={(montant) => { onChangeText={(montant) => {
this.setState({ montant }) this.setState({montant})
}} }}
style={styles.input} style={styles.input}
> >
@ -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'}
@ -372,7 +379,7 @@ class EnvoieWalletToBankUser extends Component {
secureTextEntry={true} secureTextEntry={true}
value={this.state.password} value={this.state.password}
onChangeText={(password) => { onChangeText={(password) => {
this.setState({ password }) this.setState({password})
}} }}
style={styles.input} style={styles.input}
> >
@ -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);

View File

@ -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>

View File

@ -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>

View File

@ -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
}, },

View File

@ -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",

View File

@ -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",

47
webservice/BankApi.js Normal file
View File

@ -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());
}
}

View File

@ -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());
}
}

View File

@ -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";