emptyMessage.stories.js 3.4 KB

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