lbry-desktop/ui/page/transactionHistory/index.js

28 lines
792 B
JavaScript
Raw Normal View History

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';
import TransactionHistoryPage from './view';
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)
);