// @flow import React, { Component } from 'react' import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup' import { MdSearch } from 'react-icons/lib/md' import Payments from './components/Payments' import Invoices from './components/Invoices' import styles from './Activity.scss' class Activity extends Component { constructor(props, context) { super(props, context) this.state = { tab: 1 } } componentWillMount() { const { fetchPayments, fetchInvoices } = this.props fetchPayments() fetchInvoices() } render() { const { tab } = this.state const { ticker, searchInvoices, invoices, invoice: { invoicesSearchText, invoice, invoiceLoading }, payment: { payment, payments, paymentLoading }, setPayment, setInvoice, paymentModalOpen, invoiceModalOpen } = this.props if (invoiceLoading || paymentLoading) { return
Loading...
} return (
tab === 1 ? null : searchInvoices(event.target.value)} className={`${styles.text} ${styles.input}`} placeholder={tab === 1 ? 'Search transactions by amount, public key, channel' : 'Search requests by memo'} type='text' />
this.setState({ tab: 1 })} > Payments this.setState({ tab: 2 })} > Requests
{ tab === 1 ? : }
) } } export default Activity