From ac4544b1093ac8c899265d2ea65ba0f12ec2b936 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Tue, 22 Feb 2022 15:25:26 +0500 Subject: [PATCH] simplified action press logic --- .../coinDetails/screen/coinDetailsScreen.tsx | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/screens/coinDetails/screen/coinDetailsScreen.tsx b/src/screens/coinDetails/screen/coinDetailsScreen.tsx index 042ea1c60..f2b5cfd72 100644 --- a/src/screens/coinDetails/screen/coinDetailsScreen.tsx +++ b/src/screens/coinDetails/screen/coinDetailsScreen.tsx @@ -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({