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' return 'online'
} }
const usdAmount = btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd)
return ( return (
<div className={styles.network}> <div className={styles.network}>
<header className={styles.header}> <header className={styles.header}>
<section> <section>
<h2>My Network</h2> <h2>My Network</h2>
<span className={styles.channelAmount}> <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> </span>
</section> </section>
<section className={styles.addChannel} onClick={openContactsForm}> <section className={styles.addChannel} onClick={openContactsForm}>

4
app/components/Wallet/Wallet.js

@ -32,7 +32,7 @@ class Wallet extends Component {
} = this.props } = this.props
const { modalOpen, qrCodeType } = this.state 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 changeQrCode = () => {
const qrCodeNum = this.state.qrCodeType === 1 ? 2 : 1 const qrCodeNum = this.state.qrCodeType === 1 ? 2 : 1
@ -82,7 +82,7 @@ class Wallet extends Component {
<Isvg className={styles.bitcoinLogo} src={qrCode} /> <Isvg className={styles.bitcoinLogo} src={qrCode} />
</span> </span>
</h1> </h1>
<span className={styles.usdValue}> ${usdAmount}</span> <span className={styles.usdValue}> ${usdAmount ? usdAmount.toLocaleString() : ''}</span>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save