emptyMessage.stories.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import styled from '@emotion/styled';
  2. import Button from 'sentry/components/button';
  3. import {Panel, PanelHeader} from 'sentry/components/panels';
  4. import {IconTelescope, IconUser} from 'sentry/icons';
  5. import space from 'sentry/styles/space';
  6. import EmptyMessage from 'sentry/views/settings/components/emptyMessage';
  7. export default {
  8. title: 'Views/Empty States/Empty Messages',
  9. component: EmptyMessage,
  10. };
  11. export const Default = () => (
  12. <div style={{background: '#fff'}}>
  13. <EmptyMessage>Nothing to see here</EmptyMessage>
  14. </div>
  15. );
  16. Default.storyName = 'Default';
  17. Default.parameters = {
  18. docs: {
  19. description: {
  20. story: 'Super Generic',
  21. },
  22. },
  23. };
  24. export const InPanel = () => (
  25. <Panel>
  26. <PanelHeader>Audit Log</PanelHeader>
  27. <EmptyMessage>No critical actions taken in this period</EmptyMessage>
  28. </Panel>
  29. );
  30. InPanel.storyName = 'In Panel';
  31. export const InPanelWithIcon = () => (
  32. <Panel>
  33. <PanelHeader>Members</PanelHeader>
  34. <EmptyMessage icon={<IconUser size="xl" />} size="large">
  35. Sentry is better with friends
  36. </EmptyMessage>
  37. </Panel>
  38. );
  39. InPanelWithIcon.storyName = 'In Panel - With Icon';
  40. InPanel.parameters = {
  41. docs: {
  42. description: {
  43. story: 'Put this in a panel for maximum effect',
  44. },
  45. },
  46. };
  47. export const InPanelWithIconAndAction = () => (
  48. <Panel>
  49. <PanelHeader>Members</PanelHeader>
  50. <EmptyMessage
  51. icon={<IconUser size="xl" />}
  52. action={<Button priority="primary">Invite Members</Button>}
  53. >
  54. Sentry is better with friends
  55. </EmptyMessage>
  56. </Panel>
  57. );
  58. InPanelWithIconAndAction.storyName = 'In Panel - With Icon and Action';
  59. export const InPanelWithTitleAndDescription = () => (
  60. <Panel>
  61. <PanelHeader>Members</PanelHeader>
  62. <EmptyMessage
  63. title="Sentry is better with Friends"
  64. description="When you use sentry with friends, you'll find your world of possibilities expands!"
  65. />
  66. </Panel>
  67. );
  68. InPanelWithTitleAndDescription.storyName = 'In Panel - With Title and Description';
  69. export const InPanelWithEverything = () => (
  70. <Panel>
  71. <PanelHeader>Members</PanelHeader>
  72. <EmptyMessage
  73. icon={<IconUser size="xl" />}
  74. title="Sentry is better with friends!"
  75. description="When you use sentry with friends, you'll find your world of possibilities expands!"
  76. action={
  77. <Wrapper>
  78. <ButtonWrapper>
  79. <Button priority="primary">Invite Members</Button>
  80. </ButtonWrapper>
  81. <div>
  82. <Button>Learn More</Button>
  83. </div>
  84. </Wrapper>
  85. }
  86. />
  87. </Panel>
  88. );
  89. InPanelWithEverything.storyName = 'In Panel - With Everything';
  90. export const InOnboardingMissingFunctionalityPanel = () => (
  91. <Panel dashedBorder>
  92. <EmptyMessage
  93. icon={<IconTelescope size="xl" />}
  94. title="You're missing out on crucial functionality!"
  95. description="Enable this feature now to get the most out of Sentry. What are you waiting for? Do it!"
  96. action={
  97. <Wrapper>
  98. <ButtonWrapper>
  99. <Button priority="primary">Enable it!</Button>
  100. </ButtonWrapper>
  101. <div>
  102. <Button>Learn More</Button>
  103. </div>
  104. </Wrapper>
  105. }
  106. />
  107. </Panel>
  108. );
  109. InOnboardingMissingFunctionalityPanel.storyName =
  110. 'In Onboarding/Missing Functionality Panel';
  111. const Wrapper = styled('div')`
  112. display: flex;
  113. justify-content: center;
  114. `;
  115. const ButtonWrapper = styled('div')`
  116. margin-right: ${space(1)};
  117. `;