File size: 1,813 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean, number } from '@storybook/addon-knobs';
import { Panel, Pagination, SearchBox } from 'react-instantsearch-dom';
import { WrapWithHits } from './util';

const stories = storiesOf('Pagination', module);

stories
  .add('default', () => (
    <WrapWithHits hasPlayground={true} linkedStoryGroup="Pagination.stories.js">
      <Pagination />
    </WrapWithHits>
  ))
  .add('with all props', () => (
    <WrapWithHits hasPlayground={true} linkedStoryGroup="Pagination.stories.js">
      <Pagination
        showFirst={true}
        showLast={true}
        showPrevious={true}
        showNext={true}
        padding={2}
        totalPages={3}
      />
    </WrapWithHits>
  ))
  .add('playground', () => (
    <WrapWithHits linkedStoryGroup="Pagination.stories.js">
      <Pagination
        showFirst={boolean('show First', true)}
        showLast={boolean('show Last', true)}
        showPrevious={boolean('show Previous', true)}
        showNext={boolean('show Next', true)}
        padding={number('pages Padding', 2)}
        totalPages={number('max Pages', 3)}
      />
    </WrapWithHits>
  ))
  .add('with Panel', () => (
    <WrapWithHits hasPlayground={true} linkedStoryGroup="Pagination.stories.js">
      <Panel header="Pagination" footer="Footer">
        <Pagination />
      </Panel>
    </WrapWithHits>
  ))
  .add('with Panel but no refinement', () => (
    <WrapWithHits
      searchBox={false}
      hasPlayground={true}
      linkedStoryGroup="Pagination.stories.js"
    >
      <Panel header="Pagination" footer="Footer">
        <Pagination header="Pagination" />
      </Panel>

      <div style={{ display: 'none' }}>
        <SearchBox defaultRefinement="ds" />
      </div>
    </WrapWithHits>
  ));