import I18n from 'react-native-i18n'; import isEqual from 'lodash/isEqual'; let slugify = require('slugify'); let route = require('./../route.json'); export const thousandsSeparators = (num) => { var num_parts = num.toString().split("."); num_parts[0] = num_parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " "); return num_parts.join("."); } export const identityPieces = () => { return [ { name: I18n.t('IDENTITY_CARD') }, { name: I18n.t('PASSEPORT') }, { name: I18n.t('OTHER_IDENTITY_PIECE') }, ] } export const transactionHistoryUser = () => { return [ { description: `Dépôt de 10 000 dans le wallet UBA Fs iLink à destination de Brice Zele (+237690662238) `, date: '2020-05-15' }, { description: `Retrait de 10 000 dans le wallet UBA Fs iLink à destination de Brice Zele (+237690662238) `, date: '2020-05-20' }, ]; } export const isEmptyObject = (obj) => { for (let prop in obj) { if (obj.hasOwnProperty(prop)) { return false; } } return JSON.stringify(obj) === JSON.stringify({}); } export const isIlinkWorldWallet = (walletName) => { return isEqual(slugify(walletName).toLowerCase(), 'ilink-world'); } export const optionDepotScreen = { title: I18n.t('DEPOSIT'), subTitle: I18n.t('CHOOSE_OPTION'), options: [ { screen: route.walletDepot, icon: 'wallet', title: I18n.t('DEPOSIT_CASH_TO_WALLET'), }, { screen: route.walletDepot, icon: 'cash-refund', title: I18n.t('DEPOSIT_CASH_TO_OTHER_WALLET'), }, { screen: route.walletDepot, icon: 'credit-card', title: I18n.t('DEPOSIT_CASH_TO_VISA'), }, { screen: route.walletDepot, icon: 'bank-transfer-in', title: I18n.t('DEPOSIT_CASH_TO_BANK'), }, ] } export const optionRetraitScreen = { title: I18n.t('WITHDRAWAL'), subTitle: I18n.t('CHOOSE_OPTION'), options: [ { screen: route.walletRetrait, icon: 'cash', title: I18n.t('WITHDRAWAL_IN_CASH'), }, ] } export const optionRetraitUserScreen = { title: I18n.t('WITHDRAWAL'), subTitle: I18n.t('CHOOSE_OPTION'), options: [ { screen: route.walletDepot, icon: 'wallet', title: I18n.t('WITHDRAWAL_WALLET_TO_CASH'), }, { screen: route.walletRetrait, icon: 'credit-card-refund', title: I18n.t('WITHDRAWAL_CARD_TO_CASH'), }, { screen: route.walletRetrait, icon: 'card', title: I18n.t('WITHDRAWAL_CARD_TO_WALLET'), }, ] } export const optionDepotUserScreen = { title: I18n.t('DEPOSIT'), subTitle: I18n.t('CHOOSE_OPTION'), options: [ { screen: route.walletDepot, icon: 'wallet', title: I18n.t('DEPOSIT_WALLET_TO_WALLET'), }, { screen: route.walletDepot, icon: 'cash-refund', title: I18n.t('DEPOSIT_TO_CASH'), }, { screen: route.walletDepot, icon: 'credit-card', title: I18n.t('DEPOSIT_TO_CARD'), }, { screen: route.walletDepot, icon: 'bank-transfer-in', title: I18n.t('DEPOSIT_TO_BANK'), }, ] }