lbry-desktop/ui/page/fileListPublished/index.js
Franco Montenegro 50ae6e2869
Add ability to search through publishes. (#7535)
* Add ability to search through publishes.

* Small fix in allClaimListMine type.

* Small fix for search claims in uploads page.

* Add search term in uri when filtering uploads.

* ui/ux touchup

* no appstrings for you

* resolve conflicts

Co-authored-by: jessopb <36554050+jessopb@users.noreply.github.com>
2022-04-14 23:05:59 -04:00

36 lines
1.3 KiB
JavaScript

import { connect } from 'react-redux';
import {
selectIsFetchingAllMyClaims,
selectFetchingMyClaimsPageError,
selectAllMyClaims,
} from 'redux/selectors/claims';
import { doCheckPendingClaims, doFetchAllClaimListMine } from 'redux/actions/claims';
import { doClearPublish } from 'redux/actions/publish';
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);
const initialSearchTerm = urlParams.get('searchText') || '';
return {
page,
pageSize,
fetching: selectIsFetchingAllMyClaims(state),
error: selectFetchingMyClaimsPageError(state),
myClaims: selectAllMyClaims(state),
initialSearchTerm,
};
};
const perform = (dispatch) => ({
checkPendingPublishes: () => dispatch(doCheckPendingClaims()),
clearPublish: () => dispatch(doClearPublish()),
fetchAllMyClaims: () => dispatch(doFetchAllClaimListMine()),
});
export default withRouter(connect(select, perform)(FileListPublished));