loadingError.stories.js 592 B

1234567891011121314151617181920
  1. import React from 'react';
  2. import {storiesOf} from '@storybook/react';
  3. import {action} from '@storybook/addon-actions';
  4. import {withInfo} from '@storybook/addon-info';
  5. import LoadingError from 'app/components/loadingError';
  6. storiesOf('UI|Loaders/LoadingError', module)
  7. .add(
  8. 'default',
  9. withInfo('Loading error with default message')(() => (
  10. <LoadingError onRetry={action('retry')} />
  11. ))
  12. )
  13. .add(
  14. 'custom message',
  15. withInfo('Loading error with custom message')(() => (
  16. <LoadingError message="Data failed to load" onRetry={action('retry')} />
  17. ))
  18. );