Wallet detail OK
This commit is contained in:
parent
9ebea52615
commit
a06dcff31a
File diff suppressed because one or more lines are too long
|
@ -55,6 +55,7 @@
|
||||||
"WITHDRAWAL_DESCRIPTION": "Make a withdrawal",
|
"WITHDRAWAL_DESCRIPTION": "Make a withdrawal",
|
||||||
"COMMISSION_ACCOUNT_TITLE": "Commission account",
|
"COMMISSION_ACCOUNT_TITLE": "Commission account",
|
||||||
"COMMISSION_TRANSFER_SUCCESS": "Commissions have been transferred to the main account",
|
"COMMISSION_TRANSFER_SUCCESS": "Commissions have been transferred to the main account",
|
||||||
|
"COMMISSION_TRANSFER_ERROR_EMPTY": "The commission balance is empty",
|
||||||
"CONFIRM": "Confirm",
|
"CONFIRM": "Confirm",
|
||||||
"CONFIRM_TRANSFER_COMMISSION": "Confirm commission transfer",
|
"CONFIRM_TRANSFER_COMMISSION": "Confirm commission transfer",
|
||||||
"CREATION_DATE": "Creation date",
|
"CREATION_DATE": "Creation date",
|
||||||
|
@ -270,7 +271,7 @@
|
||||||
"MAKE_REQUEST": "Make a request",
|
"MAKE_REQUEST": "Make a request",
|
||||||
"DATE_WRONG": "The end date can not be earlier than the start date",
|
"DATE_WRONG": "The end date can not be earlier than the start date",
|
||||||
"LOADING_DOTS": "Loading...",
|
"LOADING_DOTS": "Loading...",
|
||||||
"LOADING_PROGRESS": "Loading",
|
"LOADING": "Loading",
|
||||||
"EMPTY_LIST_REQUEST": "No request",
|
"EMPTY_LIST_REQUEST": "No request",
|
||||||
"MEMBER_LIST": "List of members",
|
"MEMBER_LIST": "List of members",
|
||||||
"FREE_CODE_LIST": "List of available codes",
|
"FREE_CODE_LIST": "List of available codes",
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
"CONFIRM_TRANSFER_COMMISSION": "Confirmer le transfert des commissions",
|
"CONFIRM_TRANSFER_COMMISSION": "Confirmer le transfert des commissions",
|
||||||
"PRINCIPAL_ACCOUNT_TITLE": "Cpt. principal",
|
"PRINCIPAL_ACCOUNT_TITLE": "Cpt. principal",
|
||||||
"COMMISSION_TRANSFER_SUCCESS": "Les commissions ont été transférées vers le compte principal",
|
"COMMISSION_TRANSFER_SUCCESS": "Les commissions ont été transférées vers le compte principal",
|
||||||
|
"COMMISSION_TRANSFER_ERROR_EMPTY": "Le solde commission est vide",
|
||||||
"TRANSACTIONS": "Transactions",
|
"TRANSACTIONS": "Transactions",
|
||||||
"TRANSACTION_HISTORY": "Historique des transactions",
|
"TRANSACTION_HISTORY": "Historique des transactions",
|
||||||
"WITHDRAWAL_TRANSACTION_HISTORY_DESCRIPTION": "Retrait de",
|
"WITHDRAWAL_TRANSACTION_HISTORY_DESCRIPTION": "Retrait de",
|
||||||
|
@ -105,6 +106,7 @@
|
||||||
"EMAIL": "Email",
|
"EMAIL": "Email",
|
||||||
"COUNTRY": "Pays",
|
"COUNTRY": "Pays",
|
||||||
"LOADING_INFO": "Chargement des informations...",
|
"LOADING_INFO": "Chargement des informations...",
|
||||||
|
"LOADING": "Chargement",
|
||||||
"LOADING_DESCRIPTION_COUNTRY": "Patientez un instant ! nous récuperons les informations sur votre pays...",
|
"LOADING_DESCRIPTION_COUNTRY": "Patientez un instant ! nous récuperons les informations sur votre pays...",
|
||||||
"NETWORK": "Réseau",
|
"NETWORK": "Réseau",
|
||||||
"PHONE": "Télephone",
|
"PHONE": "Télephone",
|
||||||
|
|
|
@ -75,7 +75,7 @@ class WalletDetail extends Component {
|
||||||
this.currentLocale = (DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : DeviceInfo.getDeviceLocale());
|
this.currentLocale = (DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : DeviceInfo.getDeviceLocale());
|
||||||
moment.locale(this.currentLocale);
|
moment.locale(this.currentLocale);
|
||||||
|
|
||||||
if (this.props.navigation.state.params.hasOwnProperty('agentId')) {
|
if (this.isHomeRootView) {
|
||||||
let agentId = this.props.navigation.state.params.agentId;
|
let agentId = this.props.navigation.state.params.agentId;
|
||||||
this.props.getWalletDetailActivated(agentId);
|
this.props.getWalletDetailActivated(agentId);
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,8 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
static navigationOptions = ({ navigation }) => {
|
static navigationOptions = ({ navigation }) => {
|
||||||
return {
|
return {
|
||||||
//title: this.isHomeRootView ? this.props.navigation.state.params.wallet.network,
|
//title: I18n.t('WALLET'),
|
||||||
|
//title: this.isHomeRootView ? I18n.t('WALLET') : ((typeof this.props.navigation.state.params !== 'undefined') && this.props.navigation.state.params.wallet.network),
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
backgroundColor: Color.primaryColor,
|
backgroundColor: Color.primaryColor,
|
||||||
paddingTop: 10
|
paddingTop: 10
|
||||||
|
@ -233,11 +234,11 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
|
|
||||||
refresh = () => {
|
refresh = () => {
|
||||||
const { wallet } = this.props.navigation.state.params;
|
const { result } = this.props;
|
||||||
console.log("STATE NAVIGATION PARAMS REFRESH", this.props.navigation.state);
|
console.log("STATE NAVIGATION PARAMS REFRESH", this.props.navigation.state);
|
||||||
|
|
||||||
if (!this.isHomeRootView) {
|
if (!this.isHomeRootView) {
|
||||||
|
const { wallet } = this.props.navigation.state.params;
|
||||||
this.props.getWalletDetailActivated(wallet.agentId);
|
this.props.getWalletDetailActivated(wallet.agentId);
|
||||||
this.setState({
|
this.setState({
|
||||||
isTriggerRefresh: true
|
isTriggerRefresh: true
|
||||||
|
@ -249,9 +250,10 @@ class WalletDetail extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
const wallet = Array.isArray(result.response) && result.response[0];
|
||||||
let agentId = this.props.navigation.state.params.agentId;
|
let agentId = this.props.navigation.state.params.agentId;
|
||||||
this.props.getWalletDetailActivated(agentId);
|
this.props.getWalletDetailActivated(agentId);
|
||||||
this.props.getWalletTransactionHistory(this.state.wallet.id);
|
this.props.getWalletTransactionHistory(wallet.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +343,7 @@ class WalletDetail extends Component {
|
||||||
if (result !== null) {
|
if (result !== null) {
|
||||||
if (typeof result.response !== 'undefined') {
|
if (typeof result.response !== 'undefined') {
|
||||||
|
|
||||||
const wallet = result.response.filter((item) => item.id === this.state.wallet.id)
|
const wallet = Array.isArray(result.response) ? result.response[0] : result.response.filter((item) => item.id === this.state.wallet.id)
|
||||||
|
|
||||||
if (parseInt(wallet.balance_com) === 0) {
|
if (parseInt(wallet.balance_com) === 0) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
|
@ -820,7 +822,7 @@ class WalletDetail extends Component {
|
||||||
this.renderLoader() :
|
this.renderLoader() :
|
||||||
(
|
(
|
||||||
this.props.result !== null &&
|
this.props.result !== null &&
|
||||||
this.renderDetailWallet(this.props.result.response.filter((item) => item.id === this.state.wallet.id))
|
this.renderDetailWallet(this.props.result.response)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,11 @@ export const depositAction = (data) => {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
console.log('DEPOSIT ACTION', response);
|
||||||
dispatch(fetchDepositSuccess(response));
|
dispatch(fetchDepositSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
console.log('DEPOSIT ACTION', error);
|
||||||
dispatch(fetchDepositError(error.message));
|
dispatch(fetchDepositError(error.message));
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchDepositError(error.response));
|
dispatch(fetchDepositError(error.response));
|
||||||
|
|
Loading…
Reference in New Issue