Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ui-component-library / stories / molecules / Pagination.story.tsx
Size: Mime:
import React from 'react'
import { storiesOf } from '@storybook/react'
import { styled } from 'view-container'
import { Pagination } from 'molecules/Pagination'

const styles = {
  box: {
    fontFamily: 'Roboto',
  },
  h2: {
    color: '#a9a9a9',
  },
}

const renderProps = (key, i) => {
  return (
    <li key={i}>
      <b>{key}:</b> <i>{this.data[key].toString()}</i>
    </li>
  )
}

const renderStory = props => {
  this.data = props
  return (
    <div>
      <ul>{Object.keys(props).map(renderProps)}</ul>
      <hr />
      <Pagination {...props} />
    </div>
  )
}

storiesOf('molecules/Pagination', module)
  .addDecorator(story => (
    <div style={styles.box}>
      <h2 style={styles.h2}>Pagination...</h2>
      {story()}
    </div>
  ))
  .add('default', () => renderStory({}))
  .add('2000 items', () => renderStory({ total: 2000 }))
  .add('Mobile 2000 items', () => renderStory({ isMobile: true, total: 2000 }))
  .add('Mobile 2000 items, 50pp', () =>
    renderStory({ isMobile: true, total: 2000, size: 50 })
  )
  .add('2000 items, 100pp, no sizes', () =>
    renderStory({ total: 2000, size: 100, sizes: [] })
  )
  .add('1280 items, 32pp, custom sizes', () =>
    renderStory({ total: 1280, size: 32, sizes: [16, 32, 64, 128] })
  )
  .add('1280 items, 32pp, custom sizes, adaptive menu', () =>
    renderStory({
      total: 1280,
      size: 32,
      sizes: [16, 32, 64, 128],
      adaptive: true,
    })
  )