lbry-desktop/ui/component/navigationHistory/index.js

26 lines
701 B
JavaScript
Raw Normal View History

2018-08-30 07:11:05 +02:00
import { connect } from 'react-redux';
import { selectHistoryPageCount, makeSelectHistoryForPage } from 'redux/selectors/content';
import { doClearContentHistoryUri } from 'redux/actions/content';
import UserHistory from './view';
2019-03-29 15:23:32 +01:00
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
const page = Number(urlParams.get('page')) || 0;
return {
page,
pageCount: selectHistoryPageCount(state),
2019-04-04 23:05:23 +02:00
historyItems: makeSelectHistoryForPage(page)(state),
2019-03-29 15:23:32 +01:00
};
};
2018-08-30 07:11:05 +02:00
const perform = dispatch => ({
clearHistoryUri: uri => dispatch(doClearContentHistoryUri(uri)),
});
export default connect(
select,
perform
)(UserHistory);