From cdeaecb35ac792bcfa7c6b2a446e50ae27311d10 Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Thu, 8 Feb 2018 12:39:24 -0600 Subject: [PATCH] fix(max-len): refactor logic to fix max-len lint error --- app/components/Contacts/Network.js | 4 +++- app/components/Wallet/Wallet.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index 9e8d7667..27d9cd24 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -88,13 +88,15 @@ class Network extends Component { return 'online' } + const usdAmount = btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd) + return (

My Network

- {btc.satoshisToBtc(balance.channelBalance)}BTC ≈ ${btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd) ? btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd).toLocaleString() : ''} + {btc.satoshisToBtc(balance.channelBalance)}BTC ≈ ${usdAmount ? usdAmount.toLocaleString() : ''}
diff --git a/app/components/Wallet/Wallet.js b/app/components/Wallet/Wallet.js index cb704a27..dcd0021c 100644 --- a/app/components/Wallet/Wallet.js +++ b/app/components/Wallet/Wallet.js @@ -32,7 +32,7 @@ class Wallet extends Component { } = this.props const { modalOpen, qrCodeType } = this.state - const usdAmount = parseFloat(btc.satoshisToUsd(balance.walletBalance, currentTicker.price_usd)) ? parseFloat(btc.satoshisToUsd(balance.walletBalance, currentTicker.price_usd)).toLocaleString() : '' + const usdAmount = parseFloat(btc.satoshisToUsd(balance.walletBalance, currentTicker.price_usd)) const changeQrCode = () => { const qrCodeNum = this.state.qrCodeType === 1 ? 2 : 1 @@ -82,7 +82,7 @@ class Wallet extends Component { - ≈ ${usdAmount} + ≈ ${usdAmount ? usdAmount.toLocaleString() : ''}