commitRow.stories.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import React from 'react';
  2. import CommitRow from 'app/components/commitRow';
  3. export default {
  4. title: 'UI/CommitRow',
  5. component: CommitRow,
  6. };
  7. export const Default = () => {
  8. const commit = {
  9. dateCreated: '2018-11-30T18:46:31Z',
  10. message:
  11. '(improve) Add Links to Spike-Protection Email (#2408)\n\n* (improve) Add Links to Spike-Protection Email\r\n\r\nUsers now have access to useful links from the blogs and docs on Spike-protection.\r\n\r\n* fixed wording',
  12. id: 'f7f395d14b2fe29a4e253bf1d3094d61e6ad4434',
  13. author: {
  14. username: 'example@sentry.io',
  15. lastLogin: '2018-11-30T21:18:09.812Z',
  16. isSuperuser: true,
  17. isManaged: false,
  18. lastActive: '2018-11-30T21:25:15.222Z',
  19. id: '224288',
  20. isActive: true,
  21. has2fa: false,
  22. name: 'Foo Bar',
  23. avatarUrl: 'https://example.com/avatar.png',
  24. dateJoined: '2018-02-26T23:57:43.766Z',
  25. emails: [
  26. {
  27. is_verified: true,
  28. id: '231605',
  29. email: 'example@sentry.io',
  30. },
  31. ],
  32. avatar: {
  33. avatarUuid: null,
  34. avatarType: 'letter_avatar',
  35. },
  36. hasPasswordAuth: true,
  37. email: 'example@sentry.io',
  38. },
  39. repository: {
  40. id: '4',
  41. name: 'example/repo-name',
  42. provider: 'github',
  43. url: 'https://github.com/example/repo-name',
  44. status: 'active',
  45. externalSlug: 'example/repo-name',
  46. },
  47. };
  48. const nonuserCommit = {
  49. ...commit,
  50. dateCreated: '2018-11-30T18:46:31Z',
  51. author: {
  52. username: 'example@sentry.io',
  53. isActive: true,
  54. has2fa: false,
  55. name: 'Foo Bar',
  56. avatarUrl: 'https://example.com/avatar.png',
  57. dateJoined: '2018-02-26T23:57:43.766Z',
  58. emails: [
  59. {
  60. is_verified: true,
  61. id: '231605',
  62. email: 'example@sentry.io',
  63. },
  64. ],
  65. avatar: {
  66. avatarUuid: null,
  67. avatarType: 'letter_avatar',
  68. },
  69. hasPasswordAuth: true,
  70. email: 'example@sentry.io',
  71. },
  72. };
  73. return (
  74. <div>
  75. <CommitRow commit={commit} />
  76. <CommitRow commit={nonuserCommit} />
  77. </div>
  78. );
  79. };
  80. Default.storyName = 'CommitRow';