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