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 Dec 1, 2017
1 parent 028d485 commit 663504d
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 663504d

Please sign in to comment.