wallet user
This commit is contained in:
parent
a95339a81b
commit
215d20ecc5
File diff suppressed because one or more lines are too long
|
@ -1,35 +1,36 @@
|
||||||
{
|
{
|
||||||
"discover": "ILink",
|
"discover": "ILink",
|
||||||
"stackRoot": "stackcenter",
|
"stackRoot": "stackcenter",
|
||||||
"historiques": "Historique",
|
"historiques": "Historique",
|
||||||
"options": "menu",
|
"options": "menu",
|
||||||
"drawer": "drawer",
|
"drawer": "drawer",
|
||||||
"credrequester": "creditrequest",
|
"credrequester": "creditrequest",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"first": "Home",
|
"first": "Home",
|
||||||
"typeaccountcreate": "typeaccountcreate",
|
"typeaccountcreate": "typeaccountcreate",
|
||||||
"simpleusercreate": "simpleusercreate",
|
"simpleusercreate": "simpleusercreate",
|
||||||
"splashscreen": "spashscreen",
|
"splashscreen": "spashscreen",
|
||||||
"useraccount": "useraccount",
|
"useraccount": "useraccount",
|
||||||
"configurations": "configuration",
|
"configurations": "configuration",
|
||||||
"notification": "notification",
|
"notification": "notification",
|
||||||
"modalhistoryfilter": "filterhistory",
|
"modalhistoryfilter": "filterhistory",
|
||||||
"superviseurgroup": "superviseurgroup",
|
"superviseurgroup": "superviseurgroup",
|
||||||
"historyItemDetails": "historyItemDetails",
|
"historyItemDetails": "historyItemDetails",
|
||||||
"forgotpass": "forgottenpass",
|
"forgotpass": "forgottenpass",
|
||||||
"confirmcode": "confirmcode",
|
"confirmcode": "confirmcode",
|
||||||
"creationstep2": "step2",
|
"creationstep2": "step2",
|
||||||
"help": "help",
|
"help": "help",
|
||||||
"modaloading": "modaloading",
|
"modaloading": "modaloading",
|
||||||
"activateaccount": "activateaccout",
|
"activateaccount": "activateaccout",
|
||||||
"addNetwork": "addNetwork",
|
"addNetwork": "addNetwork",
|
||||||
"notificationView": "notificationview",
|
"notificationView": "notificationview",
|
||||||
"generateNetwork": "generateNetwork",
|
"generateNetwork": "generateNetwork",
|
||||||
"helpmenu": "helpMenu",
|
"helpmenu": "helpMenu",
|
||||||
"updateinfo": "updateinformation",
|
"updateinfo": "updateinformation",
|
||||||
"intersticielAds": "intersticielAds",
|
"intersticielAds": "intersticielAds",
|
||||||
"walletDetail": "walletDetail",
|
"walletDetail": "walletDetail",
|
||||||
"walletDepot": "walletDepot",
|
"walletDepot": "walletDepot",
|
||||||
"walletRetrait": "walletRetrait",
|
"walletRetrait": "walletRetrait",
|
||||||
"walletSelect": "walletSelect"
|
"walletSelect": "walletSelect",
|
||||||
|
"walletOptionSelect": "walletOptionSelect"
|
||||||
}
|
}
|
|
@ -50,10 +50,23 @@
|
||||||
"CVC_CARD_ERROR": "CVC card error format",
|
"CVC_CARD_ERROR": "CVC card error format",
|
||||||
"THIS_FIELD_IS_REQUIRED": "This field is required",
|
"THIS_FIELD_IS_REQUIRED": "This field is required",
|
||||||
"PLEASE_ENTER_THE_AMOUNT": "Please enter the amount",
|
"PLEASE_ENTER_THE_AMOUNT": "Please enter the amount",
|
||||||
|
"CHOOSE_OPTION": "Please choose an option",
|
||||||
"EXPIRY_CARD_ERROR": "Date incorrect",
|
"EXPIRY_CARD_ERROR": "Date incorrect",
|
||||||
"CARD_NUMBER_ERROR": "Card number incorrect",
|
"CARD_NUMBER_ERROR": "Card number incorrect",
|
||||||
"AMOUNT_LABEL": "Amount",
|
"AMOUNT_LABEL": "Amount",
|
||||||
"WITHDRAWAL": "Withdrawal",
|
"WITHDRAWAL": "Withdrawal",
|
||||||
|
"WITHDRAWAL_IN_CASH": "Withdrawal in cash",
|
||||||
|
"WITHDRAWAL_WALLET_TO_CASH": "Withdrawal wallet to cash",
|
||||||
|
"WITHDRAWAL_CARD_TO_WALLET": "Withdrawal card to wallet",
|
||||||
|
"WITHDRAWAL_CARD_TO_CASH": "Withdrawal card to cash",
|
||||||
|
"DEPOSIT_CASH_TO_WALLET": "Cash to wallet",
|
||||||
|
"DEPOSIT_CASH_TO_OTHER_WALLET": "Cash to another wallet",
|
||||||
|
"DEPOSIT_CASH_TO_VISA": "Cash to visa card",
|
||||||
|
"DEPOSIT_CASH_TO_BANK": "Cash to bank",
|
||||||
|
"DEPOSIT_WALLET_TO_WALLET": "Wallet to wallet",
|
||||||
|
"DEPOSIT_TO_CASH": "Deposit to cash",
|
||||||
|
"DEPOSIT_TO_CARD": "Deposit to card",
|
||||||
|
"DEPOSIT_TO_BANK": "Deposit to bank",
|
||||||
"NANO_CREDIT": "Nano credit",
|
"NANO_CREDIT": "Nano credit",
|
||||||
"NANO_SANTE": "Nano health",
|
"NANO_SANTE": "Nano health",
|
||||||
"PAIEMENT_FACTURE": "Bill payment",
|
"PAIEMENT_FACTURE": "Bill payment",
|
||||||
|
|
|
@ -56,8 +56,21 @@
|
||||||
"CARD_NUMBER_ERROR": "Numéro de carte incorrect",
|
"CARD_NUMBER_ERROR": "Numéro de carte incorrect",
|
||||||
"THIS_FIELD_IS_REQUIRED": "Ce champ est requis",
|
"THIS_FIELD_IS_REQUIRED": "Ce champ est requis",
|
||||||
"PLEASE_ENTER_THE_AMOUNT": "Veuillez renseigne le montant",
|
"PLEASE_ENTER_THE_AMOUNT": "Veuillez renseigne le montant",
|
||||||
|
"CHOOSE_OPTION": "Veuillez sélectionner une option",
|
||||||
"DEPOSIT_DESCRIPTION": "Effectuer un dépôt",
|
"DEPOSIT_DESCRIPTION": "Effectuer un dépôt",
|
||||||
"WITHDRAWAL": "Retrait",
|
"WITHDRAWAL": "Retrait",
|
||||||
|
"WITHDRAWAL_IN_CASH": "Retrait en cash",
|
||||||
|
"WITHDRAWAL_WALLET_TO_CASH": "Retrait wallet vers cash",
|
||||||
|
"WITHDRAWAL_CARD_TO_WALLET": "Retrait carte vers wallet",
|
||||||
|
"WITHDRAWAL_CARD_TO_CASH": "Retrait carte vers cash",
|
||||||
|
"DEPOSIT_CASH_TO_WALLET": "Cash vers wallet",
|
||||||
|
"DEPOSIT_CASH_TO_OTHER_WALLET": "Cash vers autre wallet",
|
||||||
|
"DEPOSIT_CASH_TO_VISA": "Cash vers carte visa",
|
||||||
|
"DEPOSIT_CASH_TO_BANK": "Cash vers banque",
|
||||||
|
"DEPOSIT_WALLET_TO_WALLET": "Wallet vers wallet",
|
||||||
|
"DEPOSIT_TO_CASH": "Dépôt vers cash",
|
||||||
|
"DEPOSIT_TO_CARD": "Dépôt vers carte",
|
||||||
|
"DEPOSIT_TO_BANK": "Dépôt vers banque",
|
||||||
"NANO_CREDIT": "Nano crédit",
|
"NANO_CREDIT": "Nano crédit",
|
||||||
"NANO_SANTE": "Nano santé",
|
"NANO_SANTE": "Nano santé",
|
||||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||||
|
|
|
@ -1389,7 +1389,7 @@ class Home extends BaseScreen {
|
||||||
barStyle="light-content"
|
barStyle="light-content"
|
||||||
translucent={true}
|
translucent={true}
|
||||||
/>
|
/>
|
||||||
{/* {
|
{
|
||||||
(this.state.loadingDialog || this.props.loading) ?
|
(this.state.loadingDialog || this.props.loading) ?
|
||||||
<View
|
<View
|
||||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
||||||
|
@ -1426,7 +1426,6 @@ class Home extends BaseScreen {
|
||||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
*/}
|
|
||||||
{this.makeCardSearch()}
|
{this.makeCardSearch()}
|
||||||
{this.makeSlidingUp()}
|
{this.makeSlidingUp()}
|
||||||
{this.makeDialogLoader()}
|
{this.makeDialogLoader()}
|
||||||
|
|
|
@ -30,8 +30,8 @@ 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, isIlinkWorldWallet, optionDepotScreen, optionRetraitScreen } from '../../utils/UtilsFunction';
|
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionDepotScreen, optionRetraitScreen, optionRetraitUserScreen, transactionHistoryLabel, isIlinkWorldWallet } from '../../utils/UtilsFunction';
|
||||||
import DeviceInfo from 'react-native-device-info'
|
import DeviceInfo from 'react-native-device-info';
|
||||||
|
|
||||||
let route = require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
@ -613,7 +613,7 @@ class WalletDetail extends Component {
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
onPress={() => { }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='cash-multiple'
|
<Icon name='cash-multiple'
|
||||||
|
@ -641,7 +641,7 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
onPress={() => { }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
<Icon name='heart-multiple'
|
<Icon name='heart-multiple'
|
||||||
color={Color.primaryColor}
|
color={Color.primaryColor}
|
||||||
|
@ -672,7 +672,7 @@ class WalletDetail extends Component {
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
onPress={() => { }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='file-document'
|
<Icon name='file-document'
|
||||||
|
@ -816,78 +816,46 @@ class WalletDetail extends Component {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHistoryTransactionItem = (item) => {
|
renderHistoryTransactionItem = (item, index) => {
|
||||||
let re = moment.tz(item.date, 'Etc/GMT+0').format();
|
|
||||||
let date = moment(re).fromNow();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
key={item.id}
|
{
|
||||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}>
|
Object.keys(item).map((element, i) => (
|
||||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
<View style={{ alignItems: 'center' }} key={i}>
|
||||||
<View style={styles.iconContent}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
<Icon name={item.type === 'debit' ? 'arrow-top-left' : 'arrow-bottom-right'}
|
{isEqual(element, 'date')
|
||||||
color={Color.primaryColor} size={20} />
|
? this.getCreationDateToHumanFormat(item[element])
|
||||||
</View>
|
:
|
||||||
<View>
|
item[element]
|
||||||
{item.type === 'debit' ? (
|
}
|
||||||
<Text style={Typography.body1}>{I18n.t('WITHDRAWAL_TRANSACTION_HISTORY_DESCRIPTION')} {item.montant}</Text>
|
</Text>
|
||||||
) :
|
</View>
|
||||||
(
|
))
|
||||||
<Text style={Typography.body1}>{I18n.t('DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION')} {item.montant}</Text>
|
}
|
||||||
)
|
|
||||||
}
|
|
||||||
<Text style={[Typography.footnote, Color.grayColor]} style={{ marginTop: 5 }}>
|
|
||||||
{date}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* <View
|
||||||
|
key={item.id}
|
||||||
|
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||||
|
<View style={styles.iconContent}>
|
||||||
|
<Icon name='arrow-bottom-right'
|
||||||
|
color={Color.primaryColor} size={20} />
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<Text style={Typography.subhead}>{item.description}</Text>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]} style={{ marginTop: 5 }}>
|
||||||
|
{date}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View> */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHistoryTransactionList = () => {
|
renderHistoryTransactionList = () => {
|
||||||
|
|
||||||
const { resultTransaction, errorTransaction } = this.props;
|
|
||||||
if (errorTransaction !== null) {
|
|
||||||
if (typeof errorTransaction.data !== 'undefined') {
|
|
||||||
return (
|
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
||||||
<Text style={Typography.body1}>{errorTransaction.data.error}</Text>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (
|
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
||||||
<Text style={Typography.body1}>{errorTransaction}</Text>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (resultTransaction !== null) {
|
|
||||||
if (resultTransaction.response !== null) {
|
|
||||||
return (
|
|
||||||
Array.isArray(resultTransaction.response) && (resultTransaction.response.length) > 0 ?
|
|
||||||
(
|
|
||||||
resultTransaction.response.map((item, ) => (
|
|
||||||
this.renderHistoryTransactionItem(item)
|
|
||||||
))
|
|
||||||
) :
|
|
||||||
(
|
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
||||||
<Text style={Typography.body1}>{I18n.t('NO_WALLET_HISTORY')}</Text>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
renderHistoryTransaction = () => {
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
@ -896,30 +864,53 @@ class WalletDetail extends Component {
|
||||||
{I18n.t('TRANSACTION_HISTORY')}
|
{I18n.t('TRANSACTION_HISTORY')}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
<ScrollView style={styles.transactionContainer}>
|
|
||||||
{
|
{
|
||||||
this.props.loadingTransaction ?
|
transactionHistoryLabel().map((item, index) => (
|
||||||
(
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
{Platform.OS === 'android'
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
?
|
{item.label}
|
||||||
(
|
</Text>
|
||||||
<>
|
</View>
|
||||||
<ProgressBarAndroid />
|
))
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
|
||||||
|
|
||||||
</>
|
|
||||||
) :
|
|
||||||
<>
|
|
||||||
<ActivityIndicator size="large" color={'#ccc'} />
|
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
</View>
|
|
||||||
) : this.renderHistoryTransactionList()
|
|
||||||
}
|
}
|
||||||
</ScrollView>
|
</View>
|
||||||
|
{
|
||||||
|
transactionHistoryUser().map((item, index) => (
|
||||||
|
this.renderHistoryTransactionItem(item, index)
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
renderHistoryTransaction = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
this.props.loadingTransaction ?
|
||||||
|
(
|
||||||
|
<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>
|
||||||
|
) : this.renderHistoryTransactionList()
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -998,12 +989,6 @@ class WalletDetail extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const isHomeRootView = this.isHomeRootView;
|
|
||||||
/*console.log("WALLET DETAILS PROPS", this.props);
|
|
||||||
console.log("isHomeRootView", isHomeRootView);
|
|
||||||
console.log("this.props.loading || this.props.loadingTransferCommission", this.props.loading || this.props.loadingTransferCommission);
|
|
||||||
console.log(this.state.scrollHeaderY);*/
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StatusBar
|
<StatusBar
|
||||||
|
@ -1082,6 +1067,17 @@ const styles = StyleSheet.create({
|
||||||
height: 250,
|
height: 250,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
},
|
},
|
||||||
|
contentService: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
blockView: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
borderBottomWidth: 0.5,
|
||||||
|
},
|
||||||
containField: {
|
containField: {
|
||||||
padding: 10,
|
padding: 10,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { getWalletTransactionHistory, getWalletTransactionHistoryReset } from '.
|
||||||
import { transferCommissionAction } from '../../webservice/WalletTransferCommission';
|
import { transferCommissionAction } from '../../webservice/WalletTransferCommission';
|
||||||
import { resetCommissionReducer } from '../../webservice/WalletTransferCommission';
|
import { resetCommissionReducer } from '../../webservice/WalletTransferCommission';
|
||||||
import Dialog, { DialogContent, DialogTitle, DialogFooter, DialogButton } from 'react-native-popup-dialog';
|
import Dialog, { DialogContent, DialogTitle, DialogFooter, DialogButton } from 'react-native-popup-dialog';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
import { baseUrl } from '../../webservice/IlinkConstants';
|
import { baseUrl } from '../../webservice/IlinkConstants';
|
||||||
let moment = require('moment-timezone');
|
let moment = require('moment-timezone');
|
||||||
import 'moment/locale/fr'
|
import 'moment/locale/fr'
|
||||||
|
@ -31,7 +32,7 @@ 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 } from '../../utils/UtilsFunction';
|
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionRetraitUserScreen, transactionHistoryLabel } from '../../utils/UtilsFunction';
|
||||||
import DeviceInfo from 'react-native-device-info'
|
import DeviceInfo from 'react-native-device-info'
|
||||||
|
|
||||||
let route = require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
|
@ -168,14 +169,11 @@ class WalletDetailUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh = () => {
|
refresh = () => {
|
||||||
|
let userId = this.props.navigation.state.params.userId;
|
||||||
let agentId = this.props.navigation.state.params.userId;
|
this.props.getWalletDetailActivated(userId, null);
|
||||||
this.props.getWalletDetailActivated(agentId, null);
|
|
||||||
//this.props.getWalletDetailActivated(agentId, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
renderHeader = (wallet) => (
|
renderHeader = (wallet) => (
|
||||||
<View style={[
|
<View style={[
|
||||||
styles.containField,
|
styles.containField,
|
||||||
|
@ -426,7 +424,7 @@ class WalletDetailUser extends Component {
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
onPress={() => { }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='cash-multiple'
|
<Icon name='cash-multiple'
|
||||||
|
@ -485,7 +483,7 @@ class WalletDetailUser extends Component {
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
onPress={() => { }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='file-document'
|
<Icon name='file-document'
|
||||||
|
@ -561,35 +559,73 @@ class WalletDetailUser extends Component {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHistoryTransactionItem = (item) => {
|
|
||||||
let re = moment.tz(item.date, 'Etc/GMT+0').format();
|
renderHistoryTransactionItem = (item, index) => {
|
||||||
let date = moment(re).fromNow();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
key={item.id}
|
{
|
||||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}>
|
Object.keys(item).map((element, i) => (
|
||||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
<View style={{ alignItems: 'center' }} key={i}>
|
||||||
<View style={styles.iconContent}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
<Icon name='arrow-bottom-right'
|
{isEqual(element, 'date')
|
||||||
color={Color.primaryColor} size={20} />
|
? this.getCreationDateToHumanFormat(item[element])
|
||||||
</View>
|
:
|
||||||
<View>
|
item[element]
|
||||||
<Text style={Typography.subhead}>{item.description}</Text>
|
}
|
||||||
<Text style={[Typography.caption1, Color.grayColor]} style={{ marginTop: 5 }}>
|
</Text>
|
||||||
{date}
|
</View>
|
||||||
</Text>
|
))
|
||||||
</View>
|
}
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* <View
|
||||||
|
key={item.id}
|
||||||
|
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||||
|
<View style={styles.iconContent}>
|
||||||
|
<Icon name='arrow-bottom-right'
|
||||||
|
color={Color.primaryColor} size={20} />
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<Text style={Typography.subhead}>{item.description}</Text>
|
||||||
|
<Text style={[Typography.caption1, Color.grayColor]} style={{ marginTop: 5 }}>
|
||||||
|
{date}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View> */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHistoryTransactionList = () => {
|
renderHistoryTransactionList = () => {
|
||||||
return (
|
return (
|
||||||
transactionHistoryUser().map((item, ) => (
|
<>
|
||||||
this.renderHistoryTransactionItem(item)
|
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||||
))
|
<Text
|
||||||
|
style={[Typography.title3, Typography.semibold]}>
|
||||||
|
{I18n.t('TRANSACTION_HISTORY')}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
|
||||||
|
{
|
||||||
|
transactionHistoryLabel().map((item, index) => (
|
||||||
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
|
{item.label}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
{
|
||||||
|
transactionHistoryUser().map((item, index) => (
|
||||||
|
this.renderHistoryTransactionItem(item, index)
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,52 +634,27 @@ class WalletDetailUser extends Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
{
|
||||||
<View
|
this.props.loadingTransaction ?
|
||||||
style={[
|
(
|
||||||
styles.contentService,
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
{ borderBottomColor: Color.primaryColor },
|
{Platform.OS === 'android'
|
||||||
]}>
|
?
|
||||||
{[
|
(
|
||||||
{ key: '1', name: 'wifi' },
|
|
||||||
{ key: '2', name: 'coffee' },
|
|
||||||
{ key: '3', name: 'bath' },
|
|
||||||
{ key: '4', name: 'car' },
|
|
||||||
{ key: '5', name: 'paw' },
|
|
||||||
].map((item, index) => (
|
|
||||||
<View style={{ alignItems: 'center' }} key={'service' + index}>
|
|
||||||
<Icon name={item.name} size={24} color={Color.accentColor} />
|
|
||||||
<Text overline grayColor style={{ marginTop: 4 }}>
|
|
||||||
{item.name}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<ScrollView style={styles.transactionContainer}>
|
|
||||||
{
|
|
||||||
this.props.loadingTransaction ?
|
|
||||||
(
|
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
||||||
{Platform.OS === 'android'
|
|
||||||
?
|
|
||||||
(
|
|
||||||
<>
|
|
||||||
<ProgressBarAndroid />
|
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
|
||||||
|
|
||||||
</>
|
|
||||||
) :
|
|
||||||
<>
|
<>
|
||||||
<ActivityIndicator size="large" color={'#ccc'} />
|
<ProgressBarAndroid />
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
}
|
) :
|
||||||
</View>
|
<>
|
||||||
) : this.renderHistoryTransactionList()
|
<ActivityIndicator size="large" color={'#ccc'} />
|
||||||
}
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
</ScrollView>
|
</>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
) : this.renderHistoryTransactionList()
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -800,6 +811,7 @@ const styles = StyleSheet.create({
|
||||||
},
|
},
|
||||||
transactionContainer: {
|
transactionContainer: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
flex: 1,
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
|
|
|
@ -23,15 +23,46 @@ export const identityPieces = () => {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const transactionHistoryLabel = () => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
icon: 'arrow-expand',
|
||||||
|
label: 'Type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'inbox-arrow-up',
|
||||||
|
label: 'Source'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'cash',
|
||||||
|
label: 'Montant'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'account-arrow-right',
|
||||||
|
label: 'Destinataire'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'calendar-clock',
|
||||||
|
label: 'Date'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export const transactionHistoryUser = () => {
|
export const transactionHistoryUser = () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
description: `Dépôt de 10 000 dans le wallet UBA Fs iLink à destination de Brice Zele (+237690662238) `,
|
type: 'depot',
|
||||||
date: '2020-05-15'
|
source: 'wallet',
|
||||||
|
montant: 10000,
|
||||||
|
destinataire: 'John Doe',
|
||||||
|
date: '2020-05-15',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: `Retrait de 10 000 dans le wallet UBA Fs iLink à destination de Brice Zele (+237690662238) `,
|
type: 'retrait',
|
||||||
date: '2020-05-20'
|
source: 'wallet',
|
||||||
|
montant: 10000,
|
||||||
|
destinataire: 'John Doe',
|
||||||
|
date: '2020-05-15',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue