appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 470 forks source link

renderSortOptions in <ReactiveList /> available #1065

Open kud opened 4 years ago

kud commented 4 years ago

Like renderResultStats or renderNoResults, make renderSortOptions for customisation.

https://github.com/appbaseio/reactivesearch/blob/next/packages/web/src/components/result/ReactiveList.js#L616

jyash97 commented 4 years ago

Hey @kud This sounds good. Open to accept PRs on this. :)

kvin97 commented 4 years ago

Hey, I would like to work on this

jyash97 commented 4 years ago

Sure you can work on this 👍

kvin97 commented 4 years ago

Hey @kud @jyash97 Need to clear some points. renderNoResults and renderSortOptions are written in similar manner, and render to the dom as follows.

.......{this.props.sortOptions ? this.renderSortOptions() : null} {!this.props.isLoading && !error && filteredResults.length === 0? this.renderNoResults(): null}......

renderResultStats is implemented with conditional rendering using if/else statements.

It seems that renderSortOptions is not so different from renderResultStats or renderNoResults.

Therefore, need to clear the following 2 questions.

  1. What kind of customization is needed for renderSortOptions?
  2. What kind of output should be given with renderSortOptions,once the customization is done?