note.stories.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React from 'react';
  2. import {action} from '@storybook/addon-actions';
  3. import Note from 'app/components/activity/note';
  4. import ConfigStore from 'app/stores/configStore';
  5. // TODO(scttcper): Not working
  6. const user = {
  7. username: 'billy@sentry.io',
  8. identities: [],
  9. id: '1',
  10. name: 'billy@sentry.io',
  11. dateJoined: '2019-03-09T06:52:42.836Z',
  12. avatar: {avatarUuid: null, avatarType: 'letter_avatar'},
  13. email: 'billy@sentry.io',
  14. };
  15. ConfigStore.set('user', {...user, isSuperuser: true, options: {}});
  16. export default {
  17. title: 'UI/Activity/Note',
  18. };
  19. export const Default = () => (
  20. <Note
  21. author={{name: 'Billy'}}
  22. item={{id: '123', data: {text: 'hello'}, user, dateCreated: new Date()}}
  23. group={{project: {slug: 'sentry'}}}
  24. onDelete={action('Deleted item')}
  25. sessionUser={{}}
  26. memberList={[]}
  27. />
  28. );
  29. Default.storyName = 'Note';
  30. Default.parameters = {
  31. docs: {
  32. description: {
  33. story:
  34. 'A `<Note>` is an `<ActivityItem>` that can be edited with an editor. The editor has an input mode and a preview mode.',
  35. },
  36. },
  37. };