|
|
@ -7,6 +7,7 @@ import 'moment-timezone' |
|
|
|
import QRCode from 'qrcode.react' |
|
|
|
|
|
|
|
import { MdCheck } from 'react-icons/lib/md' |
|
|
|
import { FaCircle } from 'react-icons/lib/fa' |
|
|
|
|
|
|
|
import CurrencyIcon from 'components/CurrencyIcon' |
|
|
|
import { btc } from 'utils' |
|
|
@ -16,20 +17,33 @@ import styles from './Invoice.scss' |
|
|
|
|
|
|
|
const Invoice = ({ invoice, ticker, currentTicker }) => ( |
|
|
|
<div className={styles.container}> |
|
|
|
<h3>{invoice.memo}</h3> |
|
|
|
<h1> |
|
|
|
<CurrencyIcon currency={ticker.currency} crypto={ticker.crypto} styles={{ verticalAlign: 'top' }} /> |
|
|
|
<span className={styles.value}> |
|
|
|
{ |
|
|
|
ticker.currency === 'usd' ? |
|
|
|
btc.satoshisToUsd(invoice.value, currentTicker.price_usd) |
|
|
|
: |
|
|
|
btc.satoshisToBtc(invoice.value) |
|
|
|
} |
|
|
|
</span> |
|
|
|
</h1> |
|
|
|
<div className={styles.settled}> |
|
|
|
{ |
|
|
|
!invoice.settled && |
|
|
|
<p> |
|
|
|
<FaCircle /> |
|
|
|
<span>Not Paid</span> |
|
|
|
</p> |
|
|
|
} |
|
|
|
</div> |
|
|
|
<header> |
|
|
|
<h3>{invoice.memo}</h3> |
|
|
|
<h1> |
|
|
|
<span className={styles.value}> |
|
|
|
{ |
|
|
|
ticker.currency === 'usd' ? |
|
|
|
btc.satoshisToUsd(invoice.value, currentTicker.price_usd) |
|
|
|
: |
|
|
|
btc.satoshisToBtc(invoice.value) |
|
|
|
} |
|
|
|
</span> |
|
|
|
<i>BTC</i> |
|
|
|
</h1> |
|
|
|
</header> |
|
|
|
<div className={styles.qrcode}> |
|
|
|
<QRCode value={invoice.payment_request} size={200} /> |
|
|
|
<QRCode value={invoice.payment_request} size={150} /> |
|
|
|
</div> |
|
|
|
<div className={styles.input}> |
|
|
|
<input |
|
|
|
readOnly |
|
|
|
className={styles.paymentRequest} |
|
|
@ -37,14 +51,6 @@ const Invoice = ({ invoice, ticker, currentTicker }) => ( |
|
|
|
defaultValue={invoice.payment_request} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div className={styles.settled}> |
|
|
|
{ |
|
|
|
invoice.settled ? |
|
|
|
<p><MdCheck style={{ verticalAlign: 'top' }} /> Paid</p> |
|
|
|
: |
|
|
|
<p>Not Paid</p> |
|
|
|
} |
|
|
|
</div> |
|
|
|
<p className={styles.date}> |
|
|
|
Created on |
|
|
|
<Moment format='MMM Do'>{invoice.creation_date * 1000}</Moment> |
|
|
|