lbry-desktop/ui/page/fileListPublished/index.js
infinite-persistence 475256e63a Uploads: Add 'All,Uploads,Reposts' filter
## Issue
- Closes item 2 of 4563: Publish page + reposts
- Requires [lbry-redux::392](https://github.com/lbryio/lbry-redux/pull/392/files)

Also removed the redundant double spinner.
2021-03-16 12:04:39 -04:00

41 lines
1.3 KiB
JavaScript

import { connect } from 'react-redux';
import {
selectIsFetchingClaimListMine,
selectMyClaimsPage,
selectMyClaimsPageItemCount,
selectFetchingMyClaimsPageError,
doClearPublish,
doFetchClaimListMine,
doCheckPendingClaims,
} from 'lbry-redux';
import { selectUploadCount } from 'lbryinc';
import FileListPublished from './view';
import { withRouter } from 'react-router';
import { MY_CLAIMS_PAGE_SIZE, PAGE_PARAM, PAGE_SIZE_PARAM } from 'constants/claim';
const select = (state, props) => {
const { search } = props.location;
const urlParams = new URLSearchParams(search);
const page = Number(urlParams.get(PAGE_PARAM)) || '1';
const pageSize = urlParams.get(PAGE_SIZE_PARAM) || String(MY_CLAIMS_PAGE_SIZE);
return {
page,
pageSize,
fetching: selectIsFetchingClaimListMine(state),
urls: selectMyClaimsPage(state),
urlTotal: selectMyClaimsPageItemCount(state),
error: selectFetchingMyClaimsPageError(state),
uploadCount: selectUploadCount(state),
};
};
const perform = (dispatch) => ({
checkPendingPublishes: () => dispatch(doCheckPendingClaims()),
fetchClaimListMine: (page, pageSize, resolve, filterBy) =>
dispatch(doFetchClaimListMine(page, pageSize, resolve, filterBy)),
clearPublish: () => dispatch(doClearPublish()),
});
export default withRouter(connect(select, perform)(FileListPublished));