note.stories.js 1.0 KB

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