allow scrolling for displaying more search results #110
3 changed files with 9 additions and 8 deletions
|
@ -136,6 +136,8 @@ const Constants = {
|
|||
|
||||
DEFAULT_PAGE_SIZE: 10,
|
||||
|
||||
SEARCH_RESULTS_PAGE_SIZE: 25,
|
||||
|
||||
ALL_PLACEHOLDER: '_all',
|
||||
|
||||
MORE_PLACEHOLDER: '_more',
|
||||
|
|
|
@ -18,23 +18,23 @@ import { selectCurrentRoute } from 'redux/selectors/drawer';
|
|||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import SearchPage from './view';
|
||||
|
||||
const numSearchResults = 25;
|
||||
|
||||
const select = state => ({
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
currentRoute: selectCurrentRoute(state),
|
||||
isSearching: selectIsSearching(state),
|
||||
query: selectSearchValue(state),
|
||||
resolvingUris: selectResolvingUris(state),
|
||||
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, numSearchResults)(state))(state),
|
||||
results: makeSelectResolvedSearchResults(makeSelectQueryWithOptions(null, numSearchResults)(state))(state),
|
||||
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, Constants.SEARCH_RESULTS_PAGE_SIZE)(state))(state),
|
||||
results: makeSelectResolvedSearchResults(makeSelectQueryWithOptions(null, Constants.SEARCH_RESULTS_PAGE_SIZE)(state))(
|
||||
state,
|
||||
),
|
||||
lastPageReached: makeSelectResolvedSearchResultsLastPageReached(
|
||||
makeSelectQueryWithOptions(null, numSearchResults)(state),
|
||||
makeSelectQueryWithOptions(null, Constants.SEARCH_RESULTS_PAGE_SIZE)(state),
|
||||
)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
search: (query, from) => dispatch(doResolvedSearch(query, numSearchResults, from, false, {})),
|
||||
search: (query, from) => dispatch(doResolvedSearch(query, Constants.SEARCH_RESULTS_PAGE_SIZE, from, false, {})),
|
||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
|
||||
|
|
|
@ -20,7 +20,6 @@ import FloatingWalletBalance from 'component/floatingWalletBalance';
|
|||
import UriBar from 'component/uriBar';
|
||||
import searchStyle from 'styles/search';
|
||||
|
||||
const pageSize = 25;
|
||||
const softLimit = 500;
|
||||
|
||||
class SearchPage extends React.PureComponent {
|
||||
|
@ -195,7 +194,7 @@ class SearchPage extends React.PureComponent {
|
|||
};
|
||||
|
||||
handleVerticalEndReached = () => {
|
||||
// fetch more content
|
||||
// fetch more results
|
||||
const { lastPageReached, results, search, isSearching } = this.props;
|
||||
if (lastPageReached || (results && results.length > softLimit)) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue