wallet user ok
This commit is contained in:
parent
21f51c7cf5
commit
a95339a81b
7
App.js
7
App.js
|
@ -49,6 +49,7 @@ import WalletDepot from './screens/wallet/WalletDepot';
|
||||||
import WalletRetrait from './screens/wallet/WalletRetrait';
|
import WalletRetrait from './screens/wallet/WalletRetrait';
|
||||||
import CreateIdentification from './screens/identification/createIdentification';
|
import CreateIdentification from './screens/identification/createIdentification';
|
||||||
import WalletDetailUser from './screens/wallet/WalletDetailUser';
|
import WalletDetailUser from './screens/wallet/WalletDetailUser';
|
||||||
|
import WalletOptionSelect from './screens/wallet/WalletOptionSelect';
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||||
|
@ -86,7 +87,8 @@ const AppStack = createDrawerNavigator({
|
||||||
notificationview: Notifications,
|
notificationview: Notifications,
|
||||||
configuration: Configurations,
|
configuration: Configurations,
|
||||||
about: About,
|
about: About,
|
||||||
walletDetailUser: WalletDetailUser
|
walletDetailUser: WalletDetailUser,
|
||||||
|
walletOptionSelect: WalletOptionSelect
|
||||||
|
|
||||||
})
|
})
|
||||||
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
||||||
|
@ -137,7 +139,8 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
about: About,
|
about: About,
|
||||||
walletDetail: WalletDetail,
|
walletDetail: WalletDetail,
|
||||||
walletDepot: WalletDepot,
|
walletDepot: WalletDepot,
|
||||||
walletRetrait: WalletRetrait
|
walletRetrait: WalletRetrait,
|
||||||
|
walletOptionSelect: WalletOptionSelect
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
contentComponent: OptionsMenu,
|
contentComponent: OptionsMenu,
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"release-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/ && rm -rf android/app/src/main/res/drawable-* && rm -rf android/app/src/main/res/raw/* && cd android && ./gradlew assembleRelease && cd .. && adb install android/app/build/outputs/apk/release/app-release.apk",
|
"release-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/ && rm -rf android/app/src/main/res/drawable-* && rm -rf android/app/src/main/res/raw/* && cd android && ./gradlew assembleRelease && cd .. && adb install android/app/build/outputs/apk/release/app-release.apk",
|
||||||
"debug-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ && cd android && ./gradlew assembleDebug && cd .. && adb install android/app/build/outputs/apk/debug/app-debug.apk",
|
"debug-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ && cd android && ./gradlew assembleDebug && cd .. && adb install android/app/build/outputs/apk/debug/app-debug.apk",
|
||||||
"start-emulator": "emulator -avd Nexus_5X_API_R -dns-server 8.8.8.8",
|
"start-emulator": "emulator -avd Nexus_5X_API_R -dns-server 8.8.8.8",
|
||||||
"start-emulator-pixel": "emulator -avd Pixel_2_API_29_1 -dns-server 8.8.8.8",
|
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
||||||
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
||||||
"run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release"
|
"run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release"
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,5 +31,6 @@
|
||||||
"walletDetail": "walletDetail",
|
"walletDetail": "walletDetail",
|
||||||
"walletDepot": "walletDepot",
|
"walletDepot": "walletDepot",
|
||||||
"walletRetrait": "walletRetrait",
|
"walletRetrait": "walletRetrait",
|
||||||
"walletSelect": "walletSelect"
|
"walletSelect": "walletSelect",
|
||||||
|
"walletOptionSelect": "walletOptionSelect"
|
||||||
}
|
}
|
|
@ -177,6 +177,7 @@ class Home extends BaseScreen {
|
||||||
}); */
|
}); */
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
|
console.log("USER", user);
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
if (user.phone !== undefined)
|
if (user.phone !== undefined)
|
||||||
|
@ -1388,7 +1389,8 @@ 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' }}
|
||||||
|
|
||||||
|
@ -1424,6 +1426,7 @@ 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()}
|
||||||
|
|
|
@ -251,7 +251,8 @@ export default class OptionsMenu extends Component {
|
||||||
|
|
||||||
}
|
}
|
||||||
_renderItem = (item) => {
|
_renderItem = (item) => {
|
||||||
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'walletDetail' || item === 'walletDetailUser' || item === 'walletDepot' || item === 'walletRetrait' || item === 'createIdentification') {
|
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'walletDetail' || item === 'walletDetailUser'
|
||||||
|
|| item === 'walletDepot' || item === 'walletRetrait' || item === 'createIdentification' || item === 'walletOptionSelect') {
|
||||||
return null
|
return null
|
||||||
} else {
|
} else {
|
||||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||||
|
|
|
@ -10,7 +10,6 @@ import CustomButton from '../../components/CustomButton';
|
||||||
import { Color } from '../../config/Color';
|
import { Color } from '../../config/Color';
|
||||||
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, FontWeight } from '../../config/typography';
|
import { Typography, FontWeight } from '../../config/typography';
|
||||||
import { responsiveHeight, 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';
|
||||||
|
@ -18,7 +17,7 @@ import { depositActionReset } from '../../webservice/DepositApi';
|
||||||
import { getWalletTransactionHistory, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
|
import { getWalletTransactionHistory, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
|
||||||
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 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 +30,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 } from '../../utils/UtilsFunction';
|
import { thousandsSeparators, isEmptyObject, isIlinkWorldWallet, optionDepotScreen, optionRetraitScreen } 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');
|
||||||
|
@ -464,7 +463,7 @@ class WalletDetail extends Component {
|
||||||
);
|
);
|
||||||
|
|
||||||
renderDetailWallet = (wallet) => {
|
renderDetailWallet = (wallet) => {
|
||||||
console.log("WALLET SEND", wallet);
|
console.log("WALLET NAME SLUGIFY", slugify(wallet.network));
|
||||||
return (
|
return (
|
||||||
|
|
||||||
!isEmptyObject(wallet) ?
|
!isEmptyObject(wallet) ?
|
||||||
|
@ -526,10 +525,20 @@ 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.walletDepot, {
|
onPress={() => {
|
||||||
|
if (isIlinkWorldWallet(wallet.network)) {
|
||||||
|
this.props.navigation.push(route.walletOptionSelect, {
|
||||||
|
optionSelect: optionDepotScreen,
|
||||||
wallet,
|
wallet,
|
||||||
onGoBack: () => this.refresh(),
|
onGoBack: () => this.refresh(),
|
||||||
})}
|
})
|
||||||
|
} else {
|
||||||
|
this.props.navigation.push(route.walletDepot, {
|
||||||
|
wallet,
|
||||||
|
onGoBack: () => this.refresh(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='arrow-bottom-right'
|
<Icon name='arrow-bottom-right'
|
||||||
|
@ -557,10 +566,21 @@ 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.walletRetrait, {
|
onPress={() => {
|
||||||
|
if (isIlinkWorldWallet(wallet.network)) {
|
||||||
|
this.props.navigation.push(route.walletOptionSelect, {
|
||||||
|
optionSelect: optionRetraitScreen,
|
||||||
wallet,
|
wallet,
|
||||||
onGoBack: () => this.refresh(),
|
onGoBack: () => this.refresh(),
|
||||||
})}
|
})
|
||||||
|
} else {
|
||||||
|
this.props.navigation.push(route.walletRetrait, {
|
||||||
|
wallet,
|
||||||
|
onGoBack: () => this.refresh(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
<Icon name='arrow-top-left'
|
<Icon name='arrow-top-left'
|
||||||
color={Color.primaryColor}
|
color={Color.primaryColor}
|
||||||
|
@ -586,14 +606,14 @@ class WalletDetail extends Component {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{wallet.network.toLowerCase().includes('ilink') &&
|
{isIlinkWorldWallet(wallet.network) &&
|
||||||
<>
|
<>
|
||||||
<View style={styles.transactionContainer}>
|
<View style={styles.transactionContainer}>
|
||||||
|
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
|
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { this.props.navigation.push(route.createIdentification) }}
|
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='cash-multiple'
|
<Icon name='cash-multiple'
|
||||||
|
@ -621,7 +641,7 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { }}
|
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
<Icon name='heart-multiple'
|
<Icon name='heart-multiple'
|
||||||
color={Color.primaryColor}
|
color={Color.primaryColor}
|
||||||
|
@ -652,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.createIdentification) }}
|
onPress={() => { this.props.navigation.push(route.walletOptionSelect) }}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='file-document'
|
<Icon name='file-document'
|
||||||
|
|
|
@ -31,7 +31,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 } from '../../utils/UtilsFunction';
|
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionRetraitUserScreen } 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');
|
||||||
|
@ -66,47 +66,14 @@ class WalletDetailUser extends Component {
|
||||||
moment.locale(this.currentLocale);
|
moment.locale(this.currentLocale);
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
|
|
||||||
/* this.props.getWalletTransactionHistoryReset();
|
this.props.getWalletTransactionHistoryReset();
|
||||||
this.props.depositActionReset();
|
this.props.depositActionReset();
|
||||||
this.props.resetWalletListDetailReducer();
|
this.props.resetWalletListDetailReducer();
|
||||||
|
|
||||||
if (this.isHomeRootView) {
|
this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
|
||||||
let agentId = this.props.navigation.state.params.agentId;
|
this.props.getWalletTransactionHistory(this.props.navigation.state.params.userId);
|
||||||
this.props.getWalletDetailActivated(agentId, true);
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
this.props.getWalletDetailActivated(this.props.navigation.state.params.wallet.id, false);
|
|
||||||
this.props.getWalletTransactionHistory(this.props.navigation.state.params.wallet.id);
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
static options(passProps) {
|
|
||||||
return {
|
|
||||||
topBar: {
|
|
||||||
drawBehind: false,
|
|
||||||
visible: true,
|
|
||||||
animate: true,
|
|
||||||
buttonColor: 'white',
|
|
||||||
background: {
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
rightButtons: []
|
|
||||||
},
|
|
||||||
backButton: {
|
|
||||||
visible: true,
|
|
||||||
color: "white"
|
|
||||||
},
|
|
||||||
buttonColor: "white",
|
|
||||||
background: {
|
|
||||||
color: Color.primaryDarkColor
|
|
||||||
},
|
|
||||||
statusBar: {
|
|
||||||
drawBehind: false,
|
|
||||||
visible: true,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
navBarBackgroundColor: Color.primaryColor,
|
navBarBackgroundColor: Color.primaryColor,
|
||||||
statusBarColor: Color.primaryDarkColor,
|
statusBarColor: Color.primaryDarkColor,
|
||||||
|
@ -136,7 +103,7 @@ class WalletDetailUser extends Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
/* const { result } = this.props;
|
const { result } = this.props;
|
||||||
if (result !== null) {
|
if (result !== null) {
|
||||||
if (typeof result.response !== 'undefined') {
|
if (typeof result.response !== 'undefined') {
|
||||||
const wallet = result.response[0];
|
const wallet = result.response[0];
|
||||||
|
@ -145,7 +112,7 @@ class WalletDetailUser extends Component {
|
||||||
isTriggerRefresh: false
|
isTriggerRefresh: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} */
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,30 +168,15 @@ class WalletDetailUser extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh = () => {
|
refresh = () => {
|
||||||
const { result } = this.props;
|
|
||||||
console.log("STATE NAVIGATION PARAMS REFRESH", this.props.navigation.state);
|
|
||||||
|
|
||||||
if (!this.isHomeRootView) {
|
let agentId = this.props.navigation.state.params.userId;
|
||||||
const { wallet } = this.props.navigation.state.params;
|
this.props.getWalletDetailActivated(agentId, null);
|
||||||
this.props.getWalletDetailActivated(wallet.id, false);
|
//this.props.getWalletDetailActivated(agentId, null);
|
||||||
this.props.getWalletTransactionHistory(wallet.id);
|
|
||||||
this.setState({
|
|
||||||
isTriggerRefresh: true
|
|
||||||
});
|
|
||||||
|
|
||||||
/* if (typeof this.props.navigation.state.params.onRefreshDetail !== 'undefined')
|
|
||||||
this.props.navigation.state.params.onRefreshDetail(); */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
let agentId = this.props.navigation.state.params.agentId;
|
|
||||||
this.props.getWalletDetailActivated(agentId, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
renderHeader = () => (
|
|
||||||
|
renderHeader = (wallet) => (
|
||||||
<View style={[
|
<View style={[
|
||||||
styles.containField,
|
styles.containField,
|
||||||
{
|
{
|
||||||
|
@ -236,7 +188,7 @@ class WalletDetailUser extends Component {
|
||||||
]}>
|
]}>
|
||||||
<View style={[styles.contentLeftItem]}>
|
<View style={[styles.contentLeftItem]}>
|
||||||
<Text numberOfLines={1} style={[Typography.body1, Typography.semibold]}>{I18n.t('COUNTRY')}</Text>
|
<Text numberOfLines={1} style={[Typography.body1, Typography.semibold]}>{I18n.t('COUNTRY')}</Text>
|
||||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>Gabon</Text>
|
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>Pays</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={{
|
<View style={{
|
||||||
|
@ -245,7 +197,7 @@ class WalletDetailUser extends Component {
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
}}>
|
}}>
|
||||||
<Animated.Image
|
<Animated.Image
|
||||||
source={{ uri: `https://ilink-app.com/mobilebackend/datas/img/network/uba-fs-ilink-logo.png` }}
|
source={{ uri: this.getWalletIcon(wallet) }}
|
||||||
style={{
|
style={{
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 120,
|
height: 120,
|
||||||
|
@ -267,7 +219,7 @@ class WalletDetailUser extends Component {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'flex-end'
|
justifyContent: 'flex-end'
|
||||||
}}>
|
}}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>UBA FS iLink</Text>
|
<Text style={[Typography.headline, Typography.semibold]} numberOfLines={1}>{wallet.network}</Text>
|
||||||
<Tag primary style={styles.tagFollow}>
|
<Tag primary style={styles.tagFollow}>
|
||||||
{I18n.t('CREATION_IDENTIFICATION_CLIENT')}
|
{I18n.t('CREATION_IDENTIFICATION_CLIENT')}
|
||||||
</Tag>
|
</Tag>
|
||||||
|
@ -275,7 +227,7 @@ class WalletDetailUser extends Component {
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.contentLeftItem}>
|
<View style={styles.contentLeftItem}>
|
||||||
<Text numberOfLines={1} style={[Typography.body1, Typography.semibold]} >{I18n.t('CREATION_DATE')}</Text>
|
<Text numberOfLines={1} style={[Typography.body1, Typography.semibold]} >{I18n.t('CREATION_DATE')}</Text>
|
||||||
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>Il y'a deux jours</Text>
|
<Text numberOfLines={1} adjustsFontSizeToFit={true} style={Typography.caption1}>{this.getCreationDateToHumanFormat(wallet.createdAt)}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
@ -323,7 +275,7 @@ class WalletDetailUser extends Component {
|
||||||
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 3 }}>
|
<Text style={[Typography.title3, Color.primaryColor], { marginBottom: 3 }}>
|
||||||
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
|
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={[Typography.body2]}>0</Text>
|
<Text style={[Typography.body2]}>{thousandsSeparators(wallet.balance)}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
@ -346,16 +298,16 @@ class WalletDetailUser extends Component {
|
||||||
<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]}>123456789</Text>
|
<Text style={[Typography.body2]}>{wallet.user_code}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
renderDetailWallet = () => {
|
renderDetailWallet = (wallet) => {
|
||||||
return (
|
return (
|
||||||
|
!isEmptyObject(wallet) ?
|
||||||
(<>
|
(<>
|
||||||
{this.state.triggerTransferCommission && this.renderDialogTransferCommissionResponse()}
|
{this.state.triggerTransferCommission && this.renderDialogTransferCommissionResponse()}
|
||||||
|
|
||||||
|
@ -387,12 +339,12 @@ class WalletDetailUser extends Component {
|
||||||
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}>
|
{ listener: (event) => { this.setState({ scrollHeaderY: event.nativeEvent.contentOffset.y }); } })}>
|
||||||
<View style={{ marginTop: 80, }}>
|
<View style={{ marginTop: 80, }}>
|
||||||
|
|
||||||
{this.renderHeader()}
|
{this.renderHeader(wallet)}
|
||||||
|
|
||||||
<View
|
<View
|
||||||
style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
|
||||||
{this.renderAccountDetail()}
|
{this.renderAccountDetail(wallet)}
|
||||||
|
|
||||||
<>
|
<>
|
||||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
@ -406,7 +358,11 @@ class WalletDetailUser extends Component {
|
||||||
|
|
||||||
<View style={[styles.containerTouch]}>
|
<View style={[styles.containerTouch]}>
|
||||||
<TouchableOpacity style={styles.contain}
|
<TouchableOpacity style={styles.contain}
|
||||||
onPress={() => { }}
|
onPress={() => {
|
||||||
|
this.props.navigation.push(route.walletOptionSelect, {
|
||||||
|
optionSelect: optionDepotUserScreen
|
||||||
|
})
|
||||||
|
}}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
<Icon name='arrow-bottom-right'
|
<Icon name='arrow-bottom-right'
|
||||||
color={Color.primaryColor}
|
color={Color.primaryColor}
|
||||||
|
@ -434,7 +390,11 @@ 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={() => {
|
||||||
|
this.props.navigation.push(route.walletOptionSelect, {
|
||||||
|
optionSelect: optionRetraitUserScreen
|
||||||
|
})
|
||||||
|
}}
|
||||||
activeOpacity={0.9}>
|
activeOpacity={0.9}>
|
||||||
|
|
||||||
<Icon name='arrow-top-left'
|
<Icon name='arrow-top-left'
|
||||||
|
@ -576,12 +536,12 @@ class WalletDetailUser extends Component {
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity> */}
|
</TouchableOpacity>
|
||||||
|
*/}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
|
|
||||||
|
|
||||||
{this.renderHistoryTransaction()}
|
{this.renderHistoryTransaction()}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
@ -591,7 +551,14 @@ class WalletDetailUser extends Component {
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</>)
|
</>)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
|
||||||
|
</View>
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHistoryTransactionItem = (item) => {
|
renderHistoryTransactionItem = (item) => {
|
||||||
|
@ -632,11 +599,27 @@ class WalletDetailUser extends Component {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
|
||||||
<Text
|
<View
|
||||||
style={[Typography.title3, Typography.semibold]}>
|
style={[
|
||||||
{I18n.t('TRANSACTION_HISTORY')}
|
styles.contentService,
|
||||||
|
{ borderBottomColor: Color.primaryColor },
|
||||||
|
]}>
|
||||||
|
{[
|
||||||
|
{ 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>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
<ScrollView style={styles.transactionContainer}>
|
<ScrollView style={styles.transactionContainer}>
|
||||||
{
|
{
|
||||||
|
@ -675,8 +658,23 @@ class WalletDetailUser extends Component {
|
||||||
translucent={true}
|
translucent={true}
|
||||||
/>
|
/>
|
||||||
{
|
{
|
||||||
this.renderDetailWallet()
|
((this.props.loading || this.props.loadingTransferCommission) ?
|
||||||
|
this.renderLoader() :
|
||||||
|
(
|
||||||
|
this.props.result !== null ?
|
||||||
|
|
||||||
|
Array.isArray(this.props.result.response) && (this.props.result.response.length) === 0 ?
|
||||||
|
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
|
||||||
|
</View>
|
||||||
|
:
|
||||||
|
|
||||||
|
this.renderDetailWallet(this.props.result.response)
|
||||||
|
:
|
||||||
|
null
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
@ -729,6 +727,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,
|
||||||
|
|
|
@ -0,0 +1,134 @@
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import { StyleSheet, View, Image, StatusBar, Alert, FlatList, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
|
||||||
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
const route = require('./../../route.json');
|
||||||
|
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 { readUser } from '../../webservice/AuthApi';
|
||||||
|
import { FontWeight, Typography } from '../../config/typography';
|
||||||
|
|
||||||
|
export default class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
|
this.state = {
|
||||||
|
options: this.props.navigation.state.params.optionSelect.options,
|
||||||
|
title: this.props.navigation.state.params.optionSelect.title,
|
||||||
|
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
||||||
|
hasWallet: this.props.navigation.state.params.hasOwnProperty('wallet')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static navigationOptions = ({ navigation }) => ({
|
||||||
|
header: null,
|
||||||
|
headerMode: 'none',
|
||||||
|
headerTitle: null,
|
||||||
|
activeColor: '#f0edf6',
|
||||||
|
inactiveColor: '#3e2465',
|
||||||
|
barStyle: { backgroundColor: '#694fad' },
|
||||||
|
|
||||||
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
|
drawerIcon: ({ tintColor }) => (
|
||||||
|
<Icon
|
||||||
|
name={'credit-card'}
|
||||||
|
size={24}
|
||||||
|
/>)
|
||||||
|
});
|
||||||
|
|
||||||
|
updateLangue() {
|
||||||
|
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
||||||
|
this.forceUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Provider>
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
|
||||||
|
<StatusBar
|
||||||
|
backgroundColor={Color.primaryDarkColor}
|
||||||
|
barStyle="light-content"
|
||||||
|
translucent={false}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Appbar.Header dark={true} style={{ backgroundColor: Color.primaryColor }}>
|
||||||
|
<Appbar.BackAction
|
||||||
|
onPress={() => { this.props.navigation.pop() }}
|
||||||
|
/>
|
||||||
|
<Appbar.Content
|
||||||
|
title={this.state.title}
|
||||||
|
subtitle={this.state.subTitle}
|
||||||
|
/>
|
||||||
|
</Appbar.Header>
|
||||||
|
|
||||||
|
<View style={styles.container}>
|
||||||
|
<FlatList
|
||||||
|
contentContainerStyle={{
|
||||||
|
paddingHorizontal: 20,
|
||||||
|
paddingBottom: 10,
|
||||||
|
}}
|
||||||
|
data={this.state.options}
|
||||||
|
keyExtractor={(item, index) => index.toString()}
|
||||||
|
renderItem={({ item, index }) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[styles.item, { borderBottomColor: Color.borderColor }]}
|
||||||
|
onPress={() => {
|
||||||
|
if (this.state.hasWallet) {
|
||||||
|
this.props.navigation.push(item.screen, {
|
||||||
|
wallet: this.props.navigation.state.params.wallet,
|
||||||
|
onGoBack: () => this.props.navigation.state.params.onGoBack()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.props.navigation.push(item.screen)
|
||||||
|
}
|
||||||
|
|
||||||
|
}}>
|
||||||
|
<View style={{ flexDirection: 'row' }}>
|
||||||
|
<Icon
|
||||||
|
name={item.icon}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
size={20}
|
||||||
|
solid
|
||||||
|
style={{ marginHorizontal: 10 }}
|
||||||
|
/>
|
||||||
|
<Text style={[Typography.body1]}>{item.title}</Text>
|
||||||
|
</View>
|
||||||
|
<Icon
|
||||||
|
name="chevron-right"
|
||||||
|
size={20}
|
||||||
|
color={Color.primaryColor}
|
||||||
|
enableRTL={true}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: Color.containerBackgroundColor,
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
paddingVertical: 15,
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center"
|
||||||
|
}
|
||||||
|
});
|
|
@ -1,4 +1,7 @@
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
|
let slugify = require('slugify');
|
||||||
|
let route = require('./../route.json');
|
||||||
|
|
||||||
export const thousandsSeparators = (num) => {
|
export const thousandsSeparators = (num) => {
|
||||||
var num_parts = num.toString().split(".");
|
var num_parts = num.toString().split(".");
|
||||||
|
@ -42,3 +45,95 @@ export const isEmptyObject = (obj) => {
|
||||||
|
|
||||||
return JSON.stringify(obj) === JSON.stringify({});
|
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'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
|
@ -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",
|
||||||
|
|
|
@ -25,6 +25,7 @@ export const configActionUrl = baseUrl + '/interacted/ConfigAction.php';
|
||||||
export const logoutActionUrl = testBaseUrl + '/logout';
|
export const logoutActionUrl = testBaseUrl + '/logout';
|
||||||
|
|
||||||
export const walletActionUrl = testBaseUrl + '/walletService/wallets';
|
export const walletActionUrl = testBaseUrl + '/walletService/wallets';
|
||||||
|
export const walletUserSimpleActionUrl = testBaseUrl + '/walletService/wallets/users';
|
||||||
export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
|
export const walletDetailUrl = testBaseUrl + '/walletService/wallets';
|
||||||
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';
|
export const creditTreatDemand = testBaseUrl + '/walletService/credits/treatDemand';
|
||||||
export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDemand';
|
export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDemand';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import { walletActionUrl, commissionAmount, walletDetailUrl } from "./IlinkConstants";
|
import { walletActionUrl, commissionAmount, walletDetailUrl, walletUserSimpleActionUrl } from "./IlinkConstants";
|
||||||
import { fetchWalletListPending, fetchWalletListSuccess, fetchWalletListError, fetchWalletListReset, fetchWalletListDetailPending, fetchWalletListDetailSuccess, fetchWalletListDetailError, fetchWalletListDetailReset, fetchWalletGetCommissionPending, fetchWalletGetCommissionSuccess, fetchWalleGetCommissionError, walletGetCommissionReset } from "../redux/actions/WalletActions";
|
import { fetchWalletListPending, fetchWalletListSuccess, fetchWalletListError, fetchWalletListReset, fetchWalletListDetailPending, fetchWalletListDetailSuccess, fetchWalletListDetailError, fetchWalletListDetailReset, fetchWalletGetCommissionPending, fetchWalletGetCommissionSuccess, fetchWalleGetCommissionError, walletGetCommissionReset } from "../redux/actions/WalletActions";
|
||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
@ -47,7 +47,16 @@ export const getWalletDetailActivated = (id, isAgentCall) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
const url = isAgentCall ? `${walletActionUrl}/${id}/activated` : `${walletDetailUrl}/${id}`;
|
|
||||||
|
console.log("isAgentCall", isAgentCall);
|
||||||
|
let url = null;
|
||||||
|
if (isAgentCall === null)
|
||||||
|
url = `${walletUserSimpleActionUrl}/${id}`;
|
||||||
|
else if (isAgentCall === false)
|
||||||
|
url = `${walletDetailUrl}/${id}`;
|
||||||
|
else
|
||||||
|
url = `${walletActionUrl}/${id}/activated`;
|
||||||
|
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchWalletListDetailPending());
|
dispatch(fetchWalletListDetailPending());
|
||||||
|
@ -60,11 +69,11 @@ export const getWalletDetailActivated = (id, isAgentCall) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log("RESPONSE", response);
|
||||||
dispatch(fetchWalletListDetailSuccess(response));
|
dispatch(fetchWalletListDetailSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
console.log("ERROR", error);
|
||||||
dispatch(fetchWalletListDetailError(error.message));
|
dispatch(fetchWalletListDetailError(error.message));
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchWalletListDetailError(error.response));
|
dispatch(fetchWalletListDetailError(error.response));
|
||||||
|
|
Loading…
Reference in New Issue