showActivityModal('TRANSACTION', { transaction })}
+ onClick={() => showActivityModal('TRANSACTION', transaction.tx_hash)}
>
diff --git a/app/routes/app/containers/AppContainer.js b/app/routes/app/containers/AppContainer.js
index d20c837c..aa0b0732 100644
--- a/app/routes/app/containers/AppContainer.js
+++ b/app/routes/app/containers/AppContainer.js
@@ -71,7 +71,11 @@ import { fetchDescribeNetwork } from 'reducers/network'
import { clearError } from 'reducers/error'
-import { hideActivityModal, setActivityModalCurrencyFilters } from 'reducers/activity'
+import {
+ hideActivityModal,
+ setActivityModalCurrencyFilters,
+ activitySelectors
+} from 'reducers/activity'
import App from '../components/App'
@@ -159,6 +163,8 @@ const mapStateToProps = state => ({
network: state.network,
+ activityModalItem: activitySelectors.activityModalItem(state),
+
currentTicker: tickerSelectors.currentTicker(state),
currentCurrencyFilters: tickerSelectors.currentCurrencyFilters(state),
currencyName: tickerSelectors.currencyName(state),
@@ -364,8 +370,10 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
}
const activityModalProps = {
- modalType: stateProps.activity.modal.modalType,
- modalProps: stateProps.activity.modal.modalProps,
+ itemType: stateProps.activity.modal.itemType,
+ itemId: stateProps.activity.modal.itemId,
+ item: stateProps.activityModalItem,
+
ticker: stateProps.ticker,
currentTicker: stateProps.currentTicker,
network: stateProps.info.network,
diff --git a/test/unit/reducers/__snapshots__/activity.spec.js.snap b/test/unit/reducers/__snapshots__/activity.spec.js.snap
new file mode 100644
index 00000000..c41e52d6
--- /dev/null
+++ b/test/unit/reducers/__snapshots__/activity.spec.js.snap
@@ -0,0 +1,241 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`reducers activityReducer should correctly changeFilter 1`] = `
+Object {
+ "filter": undefined,
+ "filterPulldown": false,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": null,
+ "itemType": null,
+ "showCurrencyFilters": false,
+ },
+ "searchActive": false,
+ "searchText": "",
+}
+`;
+
+exports[`reducers activityReducer should correctly hideActivityModal 1`] = `
+Object {
+ "filter": Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All Activity",
+ },
+ "filterPulldown": false,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": null,
+ "itemType": null,
+ },
+ "searchActive": false,
+ "searchText": "",
+}
+`;
+
+exports[`reducers activityReducer should correctly setActivityModalCurrencyFilters 1`] = `
+Object {
+ "filter": Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All Activity",
+ },
+ "filterPulldown": false,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": null,
+ "itemType": null,
+ "showCurrencyFilters": undefined,
+ },
+ "searchActive": false,
+ "searchText": "",
+}
+`;
+
+exports[`reducers activityReducer should correctly showActivityModal 1`] = `
+Object {
+ "filter": Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All Activity",
+ },
+ "filterPulldown": false,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": undefined,
+ "itemType": undefined,
+ },
+ "searchActive": false,
+ "searchText": "",
+}
+`;
+
+exports[`reducers activityReducer should correctly togglePulldown 1`] = `
+Object {
+ "filter": Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All Activity",
+ },
+ "filterPulldown": true,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": null,
+ "itemType": null,
+ "showCurrencyFilters": false,
+ },
+ "searchActive": false,
+ "searchText": "",
+}
+`;
+
+exports[`reducers activityReducer should correctly updateSearchActive 1`] = `
+Object {
+ "filter": Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All Activity",
+ },
+ "filterPulldown": false,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": null,
+ "itemType": null,
+ "showCurrencyFilters": false,
+ },
+ "searchActive": undefined,
+ "searchText": "",
+}
+`;
+
+exports[`reducers activityReducer should correctly updateSearchText 1`] = `
+Object {
+ "filter": Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All Activity",
+ },
+ "filterPulldown": false,
+ "filters": Array [
+ Object {
+ "key": "ALL_ACTIVITY",
+ "name": "All",
+ },
+ Object {
+ "key": "SENT_ACTIVITY",
+ "name": "Sent",
+ },
+ Object {
+ "key": "REQUESTED_ACTIVITY",
+ "name": "Requested",
+ },
+ Object {
+ "key": "PENDING_ACTIVITY",
+ "name": "Pending",
+ },
+ ],
+ "modal": Object {
+ "itemId": null,
+ "itemType": null,
+ "showCurrencyFilters": false,
+ },
+ "searchActive": false,
+ "searchText": undefined,
+}
+`;
diff --git a/test/unit/reducers/activity.spec.js b/test/unit/reducers/activity.spec.js
new file mode 100644
index 00000000..cef1e472
--- /dev/null
+++ b/test/unit/reducers/activity.spec.js
@@ -0,0 +1,75 @@
+import activityReducer, {
+ SHOW_ACTIVITY_MODAL,
+ HIDE_ACTIVITY_MODAL,
+ CHANGE_FILTER,
+ TOGGLE_PULLDOWN,
+ SET_ACTIVITY_MODAL_CURRENCY_FILTERS,
+ UPDATE_SEARCH_ACTIVE,
+ UPDATE_SEARCH_TEXT
+} from 'reducers/activity'
+
+describe('reducers', () => {
+ describe('activityReducer', () => {
+ it('should have SHOW_ACTIVITY_MODAL', () => {
+ expect(SHOW_ACTIVITY_MODAL).toEqual('SHOW_ACTIVITY_MODAL')
+ })
+
+ it('should have HIDE_ACTIVITY_MODAL', () => {
+ expect(HIDE_ACTIVITY_MODAL).toEqual('HIDE_ACTIVITY_MODAL')
+ })
+
+ it('should have CHANGE_FILTER', () => {
+ expect(CHANGE_FILTER).toEqual('CHANGE_FILTER')
+ })
+
+ it('should have TOGGLE_PULLDOWN', () => {
+ expect(TOGGLE_PULLDOWN).toEqual('TOGGLE_PULLDOWN')
+ })
+
+ it('should have SET_ACTIVITY_MODAL_CURRENCY_FILTERS', () => {
+ expect(SET_ACTIVITY_MODAL_CURRENCY_FILTERS).toEqual('SET_ACTIVITY_MODAL_CURRENCY_FILTERS')
+ })
+
+ it('should have UPDATE_SEARCH_ACTIVE', () => {
+ expect(UPDATE_SEARCH_ACTIVE).toEqual('UPDATE_SEARCH_ACTIVE')
+ })
+
+ it('should have UPDATE_SEARCH_TEXT', () => {
+ expect(UPDATE_SEARCH_TEXT).toEqual('UPDATE_SEARCH_TEXT')
+ })
+
+ it('should correctly showActivityModal', () => {
+ expect(activityReducer(undefined, { type: SHOW_ACTIVITY_MODAL })).toMatchSnapshot()
+ })
+
+ it('should correctly hideActivityModal', () => {
+ expect(
+ activityReducer(undefined, { type: HIDE_ACTIVITY_MODAL, invoices: [1, 2] })
+ ).toMatchSnapshot()
+ })
+
+ it('should correctly changeFilter', () => {
+ expect(activityReducer(undefined, { type: CHANGE_FILTER })).toMatchSnapshot()
+ })
+
+ it('should correctly togglePulldown', () => {
+ expect(
+ activityReducer(undefined, { type: TOGGLE_PULLDOWN, invoice: 'foo' })
+ ).toMatchSnapshot()
+ })
+
+ it('should correctly setActivityModalCurrencyFilters', () => {
+ expect(
+ activityReducer(undefined, { type: SET_ACTIVITY_MODAL_CURRENCY_FILTERS })
+ ).toMatchSnapshot()
+ })
+
+ it('should correctly updateSearchActive', () => {
+ expect(activityReducer(undefined, { type: UPDATE_SEARCH_ACTIVE })).toMatchSnapshot()
+ })
+
+ it('should correctly updateSearchText', () => {
+ expect(activityReducer(undefined, { type: UPDATE_SEARCH_TEXT })).toMatchSnapshot()
+ })
+ })
+})