loadingIndicator.stories.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import {storiesOf} from '@storybook/react';
  3. import {withInfo} from '@storybook/addon-info';
  4. import LoadingIndicator from 'app/components/loadingIndicator';
  5. storiesOf('UI|Loaders/LoadingIndicator', module)
  6. .add(
  7. 'all',
  8. withInfo('Loading indicators. Triangle has negative margins.')(() => (
  9. <div>
  10. <div>
  11. Default
  12. <LoadingIndicator />
  13. </div>
  14. <div style={{marginBottom: 240}}>
  15. Mini
  16. <LoadingIndicator mini />
  17. </div>
  18. <div style={{position: 'relative'}}>
  19. Triangle
  20. <LoadingIndicator triangle />
  21. </div>
  22. <div style={{position: 'relative'}}>
  23. Finished
  24. <LoadingIndicator finished />
  25. </div>
  26. </div>
  27. ))
  28. )
  29. .add(
  30. 'default',
  31. withInfo('Default loading indicator')(() => (
  32. <LoadingIndicator>Loading message</LoadingIndicator>
  33. ))
  34. )
  35. .add(
  36. 'mini',
  37. withInfo('Small loading indicator')(() => (
  38. <LoadingIndicator mini>Loading message</LoadingIndicator>
  39. ))
  40. )
  41. .add(
  42. 'triangle',
  43. withInfo('Triangle loading indicator. Be aware it has negative margins.')(() => (
  44. <div style={{paddingBottom: 300}}>
  45. <LoadingIndicator triangle>Loading message</LoadingIndicator>
  46. </div>
  47. ))
  48. )
  49. .add(
  50. 'finished',
  51. withInfo('Add finished loading')(() => (
  52. <div style={{paddingBottom: 300}}>
  53. <LoadingIndicator finished>Finished message</LoadingIndicator>
  54. </div>
  55. ))
  56. );