lbry-desktop/ui/page/transactionHistory/index.js
2019-11-11 13:27:29 -05:00

27 lines
792 B
JavaScript

import { connect } from 'react-redux';
import { doFetchTransactions, makeSelectFilteredTransactionsForPage, selectFilteredTransactionCount } from 'lbry-redux';
import { withRouter } from 'react-router';
import TransactionHistoryPage from './view';
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),
};
};
const perform = dispatch => ({
fetchTransactions: () => dispatch(doFetchTransactions()),
});
export default withRouter(
connect(
select,
perform
)(TransactionHistoryPage)
);