simplified action press logic

This commit is contained in:
Nouman Tahir 2022-02-22 15:25:26 +05:00
parent d653a14ab5
commit ac4544b109

View File

@ -62,33 +62,23 @@ const CoinDetailsScreen = ({navigation}:CoinDetailsScreenProps) => {
let navigateTo = ROUTES.SCREENS.TRANSFER
let navigateParams = {};
if(coinId === COIN_IDS.ECENCY){
if(transferType === 'dropdown_transfer'){
navigateParams = {
transferType: 'points',
fundType:'ESTM',
balance: coinData.balance
}
} else{
let redeemType = '';
if(transferType === 'dropdown_promote'){
redeemType = 'promote';
} else if(transferType === 'dropdown_boost'){
redeemType = 'boost'
}
if(coinId === COIN_IDS.ECENCY && transferType !== 'dropdown_transfer'){
navigateTo = ROUTES.SCREENS.REDEEM;
navigateParams = {
balance:coinData.balance,
redeemType,
redeemType:transferType === 'dropdown_promote'?'promote':'boost',
}
}
} else {
const balance = transferType === 'withdraw_hive' || transferType === 'withdraw_hbd'
? coinData.savings : coinData.balance;
navigateParams = { transferType, fundType:symbol, balance, tokenAddress };
navigateParams = {
transferType:coinId === COIN_IDS.ECENCY?'points':transferType,
fundType:coinId === COIN_IDS.ECENCY?'ESTM':symbol,
balance,
tokenAddress
};
}
if (isPinCodeOpen) {
dispatch(
openPinCodeModal({