From 1d4ffc9ba0c21891046e607138332ef24d395380 Mon Sep 17 00:00:00 2001 From: ue Date: Mon, 16 Dec 2019 23:20:40 +0300 Subject: [PATCH] fixed wallet button lenght --- src/containers/steemWalletContainer.js | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/containers/steemWalletContainer.js b/src/containers/steemWalletContainer.js index ca9c98ebc..66de138e0 100644 --- a/src/containers/steemWalletContainer.js +++ b/src/containers/steemWalletContainer.js @@ -110,23 +110,20 @@ const WalletContainer = ({ ).toFixed(3), ); - setUnclaimedBalance( - `${ - get(walletData, 'rewardSteemBalance', 0) - ? `${Math.round(get(walletData, 'rewardSteemBalance', 0) * 1000) / 1000} STEEM` - : '' - } - ${ - get(walletData, 'rewardSbdBalance', 0) - ? ` ${Math.round(get(walletData, 'rewardSbdBalance', 0) * 1000) / 1000} SBD` - : '' + if ( + get(walletData, 'rewardSteemBalance', 0) || + get(walletData, 'rewardSbdBalance', 0) || + get(walletData, 'rewardVestingSteem', 0) + ) { + const getBalance = (val, cur) => (val ? Math.round(val * 1000) / 1000 + cur : ''); + + setUnclaimedBalance( + `${getBalance(get(walletData, 'rewardSteemBalance', 0), ' STEEM')} ${getBalance( + get(walletData, 'rewardSbdBalance', 0), + ' SBD', + )} ${getBalance(get(walletData, 'rewardVestingSteem', 0), ' SP')}`, + ); } - ${ - get(walletData, 'rewardVestingSteem', 0) - ? ` ${Math.round(get(walletData, 'rewardVestingSteem', 0) * 1000) / 1000} SP` - : '' - }`, - ); }, [userActivities, walletData]); // Components functions