emptyMessage.stories.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import React from 'react';
  2. import {Flex, Box} from 'grid-emotion';
  3. import {Panel, PanelHeader} from 'app/components/panels';
  4. import {storiesOf} from '@storybook/react';
  5. import {withInfo} from '@storybook/addon-info';
  6. import Button from 'app/components/button';
  7. import EmptyMessage from 'app/views/settings/components/emptyMessage';
  8. storiesOf('UI|EmptyMessage', module)
  9. .add(
  10. 'default',
  11. withInfo('Super Generic')(() => (
  12. <div style={{background: '#fff'}}>
  13. <EmptyMessage>Nothing to see here</EmptyMessage>
  14. </div>
  15. ))
  16. )
  17. .add(
  18. 'in panel',
  19. withInfo('Put this in a panel for maximum effect')(() => (
  20. <Panel>
  21. <PanelHeader>Audit Log</PanelHeader>
  22. <EmptyMessage>No critical actions taken in this period</EmptyMessage>
  23. </Panel>
  24. ))
  25. )
  26. .add(
  27. 'in panel with icon',
  28. withInfo('Put this in a panel for maximum effect')(() => (
  29. <Panel>
  30. <PanelHeader>Members</PanelHeader>
  31. <EmptyMessage icon="icon-user" size="large">
  32. Sentry is better with friends
  33. </EmptyMessage>
  34. </Panel>
  35. ))
  36. )
  37. .add(
  38. 'in panel with icon and action',
  39. withInfo('Put this in a panel for maximum effect')(() => (
  40. <Panel>
  41. <PanelHeader>Members</PanelHeader>
  42. <EmptyMessage
  43. icon="icon-user"
  44. action={<Button priority="primary">Invite Members</Button>}
  45. >
  46. Sentry is better with friends
  47. </EmptyMessage>
  48. </Panel>
  49. ))
  50. )
  51. .add(
  52. 'in panel with title and description',
  53. withInfo('Put this in a panel for maximum effect')(() => (
  54. <Panel>
  55. <PanelHeader>Members</PanelHeader>
  56. <EmptyMessage
  57. title="Sentry is better with Friends"
  58. description="When you use sentry with friends, you'll find your world of possibilities expands!"
  59. />
  60. </Panel>
  61. ))
  62. )
  63. .add(
  64. 'in panel with everything',
  65. withInfo('Put this in a panel for maximum effect')(() => (
  66. <Panel>
  67. <PanelHeader>Members</PanelHeader>
  68. <EmptyMessage
  69. icon="icon-user"
  70. title="Sentry is better with friends!"
  71. description="When you use sentry with friends, you'll find your world of possibilities expands!"
  72. action={
  73. <Flex justify="center">
  74. <Box mr={1}>
  75. <Button priority="primary">Invite Members</Button>
  76. </Box>
  77. <Box>
  78. <Button>Learn More</Button>
  79. </Box>
  80. </Flex>
  81. }
  82. />
  83. </Panel>
  84. ))
  85. )
  86. .add(
  87. 'in onboarding/missing functionality panel',
  88. withInfo('Put this in a panel for maximum effect')(() => (
  89. <Panel dashedBorder>
  90. <EmptyMessage
  91. icon="icon-discover"
  92. title="You're missing out on crucial functionality!"
  93. description="Enable this feature now to get the most out of Sentry. What are you waiting for? Do it!"
  94. action={
  95. <Flex justify="center">
  96. <Box mr={1}>
  97. <Button priority="primary">Enable it!</Button>
  98. </Box>
  99. <Box>
  100. <Button>Learn More</Button>
  101. </Box>
  102. </Flex>
  103. }
  104. />
  105. </Panel>
  106. ))
  107. );