diff --git a/app/routes/activity/components/Activity.js b/app/routes/activity/components/Activity.js index 0ce06382..37a061b6 100644 --- a/app/routes/activity/components/Activity.js +++ b/app/routes/activity/components/Activity.js @@ -37,10 +37,11 @@ class Activity extends Component { return } else if (activity.hasOwnProperty('payment_request')) { // activity is an LN invoice - return + console.log('activity: ', activity) + return } else { // activity is an LN payment - return + return } } diff --git a/app/routes/activity/components/components/Activity.scss b/app/routes/activity/components/components/Activity.scss new file mode 100644 index 00000000..de728313 --- /dev/null +++ b/app/routes/activity/components/components/Activity.scss @@ -0,0 +1,117 @@ +@import '../../../../variables.scss'; + +.container { + display: flex; + flex-direction: row; + cursor: pointer; + max-width: 960px; + margin: 0 auto; + height: 76px; + align-items: center; + border-bottom: 1px solid $grey; + font-size: 14px; + transition: background-color .1s linear; + transition-delay: .1s; + color: $darkestgrey; + position: relative; +} + +.label { + position: absolute; + top: 0; + left: -25%; +} + +.icon { + display: block; + margin-right: 20px; + flex: none; + position: relative; + width: 36px; + height: 36px; + border: 1px solid $darkestgrey; + border-radius: 50%; + + svg { + color: $main; + font-size: 16px; + vertical-align: middle; + display: flex; + top: 0; + left: 50%; + height: 100%; + margin: 0 auto; + } +} + +.data { + display: flex; + flex-direction: row; + flex: 6 0; + + .title { + flex: 8 0; + } + + .subtitle { + padding-left: 20px; + flex: 2 0; + } +} + +.subtitle, .date { + text-align: center; +} + +.date { + padding-left: 20px; + flex: 1 0; +} + +.amount { + flex: 1 0; + padding-left: 20px; + + &.negative { + font-weight: 200; + } + + &.positive { + color: $main; + font-weight: 500; + } + + section { + display: inline-block; + vertical-align: top; + text-align: right; + font-size: 0; + margin: 0; + padding: 0; + + &:nth-child(1) { + width: 20%; + } + + &:nth-child(2) { + width: 80%; + } + } + + svg { + font-size: 20px; + } + + span { + display: block; + + &:nth-child(1) { + font-size: 14px; + } + + &:nth-child(2) { + font-size: 10px; + } + } +} + diff --git a/app/routes/activity/components/components/Invoice/Invoice.js b/app/routes/activity/components/components/Invoice/Invoice.js index 89db79aa..ac1b2000 100644 --- a/app/routes/activity/components/components/Invoice/Invoice.js +++ b/app/routes/activity/components/components/Invoice/Invoice.js @@ -1,10 +1,62 @@ import React from 'react' import PropTypes from 'prop-types' -import styles from './Invoice.scss' +import Moment from 'react-moment' +import 'moment-timezone' +import { FaBolt } from 'react-icons/lib/fa' +import { btc } from '../../../../../utils' +import CurrencyIcon from '../../../../../components/CurrencyIcon' +import styles from '../Activity.scss' -const Invoice = () => ( -
- Invoice +const Invoice = ({ invoice, ticker, currentTicker }) => ( +
+ + + +
+
+ {invoice.r_hash.toString('hex')} +
+
+ {invoice.memo} +
+
+
+ + { + invoice.settled ? + invoice.settle_date * 1000 + : + invoice.creation_date * 1000 + } + +
+
+
+ +
+
+ + { + ticker.currency === 'usd' ? + btc.satoshisToUsd(invoice.value, currentTicker.price_usd) + : + btc.satoshisToBtc(invoice.value) + } + + + { + ticker.currency === 'usd' ? + btc.satoshisToUsd(invoice.fee, currentTicker.price_usd) + : + btc.satoshisToBtc(invoice.fee) + } + +
+
) diff --git a/app/routes/activity/components/components/Payment/Payment.js b/app/routes/activity/components/components/Payment/Payment.js index 833b51f6..e131b91e 100644 --- a/app/routes/activity/components/components/Payment/Payment.js +++ b/app/routes/activity/components/components/Payment/Payment.js @@ -1,10 +1,61 @@ import React from 'react' import PropTypes from 'prop-types' -import styles from './Payment.scss' +import Moment from 'react-moment' +import 'moment-timezone' +import { FaBolt } from 'react-icons/lib/fa' +import { btc } from '../../../../../utils' +import CurrencyIcon from '../../../../../components/CurrencyIcon' +import styles from '../Activity.scss' -const Payment = () => ( -
- Payment +const Payment = ({ payment, ticker, currentTicker }) => ( +
+ + + +
+
+ {payment.payment_hash} +
+
+ { + payment.path.length > 1 ? + `${payment.path.length} hops` + : + 'Directly routed' + } +
+
+
+ {payment.creation_date * 1000} +
+
+
+ +
+
+ + - + { + ticker.currency === 'usd' ? + btc.satoshisToUsd(payment.value, currentTicker.price_usd) + : + btc.satoshisToBtc(payment.value) + } + + + { + ticker.currency === 'usd' ? + btc.satoshisToUsd(payment.fee, currentTicker.price_usd) + : + btc.satoshisToBtc(payment.fee) + } + +
+
) diff --git a/app/routes/activity/components/components/Transaction/Transaction.js b/app/routes/activity/components/components/Transaction/Transaction.js index 2a16f2dc..f8f42f3e 100644 --- a/app/routes/activity/components/components/Transaction/Transaction.js +++ b/app/routes/activity/components/components/Transaction/Transaction.js @@ -5,10 +5,20 @@ import 'moment-timezone' import { FaChain } from 'react-icons/lib/fa' import { btc } from '../../../../../utils' import CurrencyIcon from '../../../../../components/CurrencyIcon' -import styles from './Transaction.scss' +import styles from '../Activity.scss' const Transaction = ({ transaction, ticker, currentTicker }) => (
+
+

+ { + transaction.amount < 0 ? + 'Sent' + : + 'Received' + } +

+