2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2019-11-01 13:27:01 -04:00
|
|
|
import { doFetchTransactions, makeSelectFilteredTransactionsForPage, selectFilteredTransactionCount } from 'lbry-redux';
|
2019-09-22 22:47:07 -04:00
|
|
|
import { withRouter } from 'react-router';
|
|
|
|
|
2017-12-21 18:08:54 -03:00
|
|
|
import TransactionHistoryPage from './view';
|
2017-08-18 23:08:01 -04:00
|
|
|
|
2019-09-22 22:47:07 -04: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 17:42:00 -04:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-11-01 15:17:06 -04:00
|
|
|
fetchTransactions: () => dispatch(doFetchTransactions()),
|
2017-08-20 17:42:00 -04:00
|
|
|
});
|
|
|
|
|
2019-09-22 22:47:07 -04:00
|
|
|
export default withRouter(
|
|
|
|
connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(TransactionHistoryPage)
|
|
|
|
);
|