allow scrolling for displaying more search results #110

Merged
akinwale merged 3 commits from search-results into master 2020-01-09 16:49:15 +01:00
3 changed files with 9 additions and 8 deletions
Showing only changes of commit 8441848f37 - Show all commits

View file

@ -136,6 +136,8 @@ const Constants = {
DEFAULT_PAGE_SIZE: 10,
SEARCH_RESULTS_PAGE_SIZE: 25,
ALL_PLACEHOLDER: '_all',
MORE_PLACEHOLDER: '_more',

View file

@ -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)),

View file

@ -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;