diff --git a/app/reducers/activity.js b/app/reducers/activity.js index 9c747bcf..1d8bacbe 100644 --- a/app/reducers/activity.js +++ b/app/reducers/activity.js @@ -5,6 +5,13 @@ import { createSelector } from 'reselect' // ------------------------------------ const initialState = { filter: 'ALL_ACTIVITY', + filters: [ + { key: 'ALL_ACTIVITY', name: 'Activity'}, + { key: 'LN_ACTIVITY', name: 'Lightning Network'}, + { key: 'PAYMENT_ACTIVITY', name: 'Payments'}, + { key: 'INVOICE_ACTIVITY', name: 'Invoices'}, + { key: 'TRANSACTION_ACTIVITY', name: 'Transactions'} + ], modal: { modalType: null, modalProps: {} @@ -54,6 +61,7 @@ const ACTION_HANDLERS = { // Selectors // ------------------------------------ const activitySelectors = {} +const filtersSelector = state => state.activity.filters const filterSelector = state => state.activity.filter const paymentsSelector = state => state.payment.payments const invoicesSelector = state => state.invoice.invoices @@ -106,6 +114,12 @@ activitySelectors.currentActivity = createSelector( filter => FILTERS[filter] ) +activitySelectors.nonActiveFilters = createSelector( + filtersSelector, + filterSelector, + (filters, filter) => filters.filter(f => f.key !== filter) +) + const FILTERS = { ALL_ACTIVITY: allActivity, LN_ACTIVITY: lnActivity, diff --git a/app/routes/activity/components/Activity.js b/app/routes/activity/components/Activity.js index 5dbf1961..4db80acb 100644 --- a/app/routes/activity/components/Activity.js +++ b/app/routes/activity/components/Activity.js @@ -15,7 +15,7 @@ class Activity extends Component { constructor(props, context) { super(props, context) this.state = { - tab: 1 + pulldown: false } this.renderActivity = this.renderActivity.bind(this) @@ -45,7 +45,6 @@ class Activity extends Component { } render() { - const { tab } = this.state const { ticker, searchInvoices, @@ -59,9 +58,10 @@ class Activity extends Component { currentTicker, activity: { modal }, hideActivityModal, - currentActivity + currentActivity, + nonActiveFilters } = this.props - + if (invoiceLoading || paymentLoading) { return
Loading...
} return ( @@ -79,10 +79,10 @@ class Activity extends Component { (tab === 1 ? null : searchInvoices(event.target.value))} + value={invoicesSearchText} + onChange={event => searchInvoices(event.target.value)} className={`${styles.text} ${styles.input}`} - placeholder={tab === 1 ? 'Search by amount, hash, memo, etc' : 'Search requests by memo'} + placeholder='Search by amount, hash, memo, etc' type='text' id='invoiceSearch' /> @@ -90,7 +90,19 @@ class Activity extends Component {
-

Activity

+

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

+
    + { + nonActiveFilters.map(filter => { + console.log('filter: ', filter) + return ( +
  • + {filter.name} +
  • + ) + }) + } +