Browse Source

fix(max-len): refactor logic to fix max-len lint error

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
cdeaecb35a
  1. 4
      app/components/Contacts/Network.js
  2. 4
      app/components/Wallet/Wallet.js

4
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 (
<div className={styles.network}>
<header className={styles.header}>
<section>
<h2>My Network</h2>
<span className={styles.channelAmount}>
{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() : ''}
</span>
</section>
<section className={styles.addChannel} onClick={openContactsForm}>

4
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 {
<Isvg className={styles.bitcoinLogo} src={qrCode} />
</span>
</h1>
<span className={styles.usdValue}> ${usdAmount}</span>
<span className={styles.usdValue}> ${usdAmount ? usdAmount.toLocaleString() : ''}</span>
</div>
</div>
</div>

Loading…
Cancel
Save