2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2019-11-01 18:27:01 +01:00
|
|
|
import { doFetchTransactions, makeSelectFilteredTransactionsForPage, selectFilteredTransactionCount } from 'lbry-redux';
|
2019-09-23 04:47:07 +02:00
|
|
|
import { withRouter } from 'react-router';
|
|
|
|
|
2017-12-21 22:08:54 +01:00
|
|
|
import TransactionHistoryPage from './view';
|
2017-08-19 05:08:01 +02:00
|
|
|
|
2019-09-23 04:47:07 +02:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { search } = props.location;
|
|
|
|
const urlParams = new URLSearchParams(search);
|
|
|
|
const page = Number(urlParams.get('page')) || 1;
|
|
|
|
return {
|
|
|
|
page,
|
|
|
|
filteredTransactionPage: makeSelectFilteredTransactionsForPage(page)(state),
|
|
|
|
filteredTransactionsCount: selectFilteredTransactionCount(state),
|
|
|
|
};
|
|
|
|
};
|
2017-08-20 23:42:00 +02:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-11-01 20:17:06 +01:00
|
|
|
fetchTransactions: () => dispatch(doFetchTransactions()),
|
2017-08-20 23:42:00 +02:00
|
|
|
});
|
|
|
|
|
2019-09-23 04:47:07 +02:00
|
|
|
export default withRouter(
|
|
|
|
connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(TransactionHistoryPage)
|
|
|
|
);
|