import React, { Component } from 'react' import PropTypes from 'prop-types' import { MdSearch } from 'react-icons/lib/md' import { FaChain, FaBolt } from 'react-icons/lib/fa' import Invoice from './components/Invoice' import Payment from './components/Payment' import Transaction from './components/Transaction' import Modal from './components/Modal' import styles from './Activity.scss' class Activity extends Component { constructor(props, context) { super(props, context) this.state = { pulldown: false } this.renderActivity = this.renderActivity.bind(this) } componentWillMount() { const { fetchPayments, fetchInvoices, fetchTransactions } = this.props fetchPayments() fetchInvoices() fetchTransactions() } renderActivity(activity) { const { ticker, currentTicker, showActivityModal } = this.props if (activity.hasOwnProperty('block_hash')) { // activity is an on-chain tx return } else if (activity.hasOwnProperty('payment_request')) { // activity is an LN invoice return } else { // activity is an LN payment return } } render() { const { ticker, searchInvoices, invoices, invoice: { invoicesSearchText, invoice, invoiceLoading }, payment: { payment, payments, paymentLoading }, setPayment, setInvoice, paymentModalOpen, invoiceModalOpen, currentTicker, activity: { modal }, hideActivityModal, currentActivity, nonActiveFilters } = this.props if (invoiceLoading || paymentLoading) { return
Loading...
} return (
searchInvoices(event.target.value)} className={`${styles.text} ${styles.input}`} placeholder='Search by amount, hash, memo, etc' type='text' id='invoiceSearch' />

this.setState({ pulldown: true })}>Activity

    { nonActiveFilters.map(filter => { console.log('filter: ', filter) return (
  • {filter.name}
  • ) }) }
    { currentActivity.map((activity, index) => { return (
  • {this.renderActivity(activity)}
  • ) }) }
) } } Activity.propTypes = { fetchPayments: PropTypes.func.isRequired, fetchInvoices: PropTypes.func.isRequired, ticker: PropTypes.object.isRequired, searchInvoices: PropTypes.func.isRequired, invoices: PropTypes.array.isRequired, invoice: PropTypes.object.isRequired, payment: PropTypes.object.isRequired, setPayment: PropTypes.func.isRequired, setInvoice: PropTypes.func.isRequired, paymentModalOpen: PropTypes.bool.isRequired, invoiceModalOpen: PropTypes.bool.isRequired, currentTicker: PropTypes.object.isRequired } export default Activity