idBadge.stories.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import IdBadge from 'sentry/components/idBadge';
  4. // TODO(scttcper): Handle dark mode
  5. const Item = styled('div')`
  6. padding: 8px;
  7. background-color: white;
  8. border: 1px dashed #fcfcfc;
  9. margin-bottom: 30px;
  10. `;
  11. Item.displayName = 'Item';
  12. const Header = styled('h2')`
  13. font-size: 18px;
  14. margin-bottom: 4px;
  15. `;
  16. Header.displayName = 'Header';
  17. export default {
  18. title: 'Components/Badges/ID Badge',
  19. components: IdBadge,
  20. };
  21. export const All = () => {
  22. const user = {
  23. name: 'Chrissy',
  24. email: 'chris.clark@sentry.io',
  25. };
  26. const team = {
  27. slug: 'team-slug',
  28. };
  29. const project = {
  30. slug: 'project-slug',
  31. };
  32. const organization = {
  33. slug: 'organization-slug',
  34. };
  35. const member = {
  36. name: 'Pending Member',
  37. email: 'member@example.org',
  38. };
  39. return (
  40. <Fragment>
  41. <Header>User Badge</Header>
  42. <Item>
  43. <IdBadge user={user} />
  44. </Item>
  45. <Header>Member Badge</Header>
  46. <Item>
  47. <IdBadge member={member} />
  48. </Item>
  49. <Header>Team Badge</Header>
  50. <Item>
  51. <IdBadge team={team} />
  52. </Item>
  53. <Header>Project Badge</Header>
  54. <Item>
  55. <IdBadge project={project} />
  56. </Item>
  57. <Header>Organization Badge</Header>
  58. <Item>
  59. <IdBadge organization={organization} />
  60. </Item>
  61. </Fragment>
  62. );
  63. };
  64. All.storyName = 'ID Badge';
  65. All.parameters = {
  66. docs: {
  67. description: {
  68. story:
  69. 'These are identification badges for certain models in Sentry: Organization, Project, Team, and User.',
  70. },
  71. },
  72. };