Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
feat(IndexStories): add story for SortBy nested in Index
Browse files Browse the repository at this point in the history
  • Loading branch information
samouss committed Nov 28, 2017
1 parent 37057f3 commit d1fe2ac
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions stories/MultiIndex.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Index,
Highlight,
SearchBox,
SortBy,
} from '../packages/react-instantsearch/dom';
import {
connectHits,
Expand Down Expand Up @@ -62,6 +63,47 @@ stories
<AutoComplete />
</InstantSearch>
))
.add('with SortBy nested in same Index as Root', () => (
<InstantSearch
appId="latency"
apiKey="6be0576ff61c053d5f9a3225e2a90f76"
indexName="categories"
>
<SearchBox />

<div className="multi-index_content">
<div className="multi-index_categories-or-brands">
<Index indexName="categories">
<Configure hitsPerPage={3} />

<SortBy
defaultRefinement="categories"
items={[
{ value: 'categories', label: 'Categories' },
{ value: 'bestbuy', label: 'Best buy' },
]}
/>

<CustomCategoriesOrBrands />
</Index>

<Index indexName="products">
<Configure hitsPerPage={3} />

<SortBy
defaultRefinement="products"
items={[
{ value: 'products', label: 'Products' },
{ value: 'brands', label: 'Brands' },
]}
/>

<CustomCategoriesOrBrands />
</Index>
</div>
</div>
</InstantSearch>
))
.add('with conditional rendering', () => (
<InstantSearch
appId="latency"
Expand Down

0 comments on commit d1fe2ac

Please sign in to comment.