File size: 1,453 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import React from 'react';
import { storiesOf } from '@storybook/react';
import { Panel, SortBy } from 'react-instantsearch-dom';
import { WrapWithHits } from './util';
const stories = storiesOf('SortBy', module);
stories
.add('default', () => (
<WrapWithHits linkedStoryGroup="SortBy.stories.js">
<SortBy
items={[
{ value: 'instant_search', label: 'Featured' },
{ value: 'instant_search_price_asc', label: 'Price asc.' },
{ value: 'instant_search_price_desc', label: 'Price desc.' },
]}
defaultRefinement="instant_search"
/>
</WrapWithHits>
))
.add('without label', () => (
<WrapWithHits linkedStoryGroup="SortBy.stories.js">
<SortBy
items={[
{ value: 'instant_search' },
{ value: 'instant_search_price_asc' },
{ value: 'instant_search_price_desc' },
]}
defaultRefinement="instant_search"
/>
</WrapWithHits>
))
.add('with Panel', () => (
<WrapWithHits linkedStoryGroup="SortBy.stories.js">
<Panel header="Sort By" footer="Footer">
<SortBy
items={[
{ value: 'instant_search', label: 'Featured' },
{ value: 'instant_search_price_asc', label: 'Price asc.' },
{ value: 'instant_search_price_desc', label: 'Price desc.' },
]}
defaultRefinement="instant_search"
/>
</Panel>
</WrapWithHits>
));
|