|
|
@ -1,10 +1,11 @@ |
|
|
|
// @flow
|
|
|
|
import React, { Component } from 'react' |
|
|
|
import { btc } from '../../../../../../../utils' |
|
|
|
import styles from './Channel.scss' |
|
|
|
|
|
|
|
class Channel extends Component { |
|
|
|
render() { |
|
|
|
const { channel, setChannel } = this.props |
|
|
|
const { ticker, channel, setChannel } = this.props |
|
|
|
return ( |
|
|
|
<li className={styles.channel} onClick={() => setChannel(channel)}> |
|
|
|
<div className={styles.left}> |
|
|
@ -20,15 +21,36 @@ class Channel extends Component { |
|
|
|
<div className={styles.right}> |
|
|
|
<section className={styles.capacity}> |
|
|
|
<span>Capacity</span> |
|
|
|
<h2>{channel.capacity}</h2> |
|
|
|
<h2> |
|
|
|
{ |
|
|
|
ticker.currency === 'btc' ? |
|
|
|
btc.satoshisToBtc(channel.capacity) |
|
|
|
: |
|
|
|
btc.satoshisToUsd(channel.capacity, ticker.btcTicker.price_usd) |
|
|
|
} |
|
|
|
</h2> |
|
|
|
</section> |
|
|
|
<div className={styles.balances}> |
|
|
|
<section> |
|
|
|
<h4>{channel.local_balance}</h4> |
|
|
|
<h4> |
|
|
|
{ |
|
|
|
ticker.currency === 'btc' ? |
|
|
|
btc.satoshisToBtc(channel.local_balance) |
|
|
|
: |
|
|
|
btc.satoshisToUsd(channel.local_balance, ticker.btcTicker.price_usd) |
|
|
|
} |
|
|
|
</h4> |
|
|
|
<span>Local</span> |
|
|
|
</section> |
|
|
|
<section> |
|
|
|
<h4>{channel.remote_balance}</h4> |
|
|
|
<h4> |
|
|
|
{ |
|
|
|
ticker.currency === 'btc' ? |
|
|
|
btc.satoshisToBtc(channel.remote_balance) |
|
|
|
: |
|
|
|
btc.satoshisToUsd(channel.remote_balance, ticker.btcTicker.price_usd) |
|
|
|
} |
|
|
|
</h4> |
|
|
|
<span>Remote</span> |
|
|
|
</section> |
|
|
|
</div> |
|
|
|