import ActivityItem from 'sentry/components/activity/item'; import ActivityAvatar from 'sentry/components/activity/item/avatar'; import ActivityBubble from 'sentry/components/activity/item/bubble'; const user = { username: 'billy@sentry.io', identities: [], id: '1', name: 'billy@sentry.io', dateJoined: '2019-03-09T06:52:42.836Z', avatar: {avatarUuid: null, avatarType: 'letter_avatar'}, email: 'billy@sentry.io', }; export default { title: 'Views/Activity/Activity Item', }; export const DefaultActivityItem = ({hideDate}) => ( {user.email}} hideDate={hideDate} > Activity Item ); DefaultActivityItem.storyName = 'Default'; DefaultActivityItem.args = { hideDate: false, }; DefaultActivityItem.parameters = { docs: { description: { story: 'An Activity Item is composed of: an author, header, body, and additionally timestamp and a status.', }, }, }; export const WithCustomHeader = ({hideDate}) => ( (
Custom header (no timestamp)
)} hideDate={hideDate} > Activity Item
); WithCustomHeader.storyName = 'with custom Header'; WithCustomHeader.args = { hideDate: false, }; WithCustomHeader.parameters = { docs: { description: { story: 'Activity Item with a custom header', }, }, }; export const WithFooter = ({hideDate}) => ( {user.email}} footer={
Footer
} hideDate={hideDate} > Activity Item
); WithFooter.storyName = 'with footer'; WithFooter.args = { hideDate: false, }; WithFooter.parameters = { docs: { description: { story: 'Activity Item with a footer', }, }, }; export const SystemActivity = ({hideDate}) => ( Sentry detected something} hideDate={hideDate} > Sentry did something ); SystemActivity.storyName = 'system activity'; SystemActivity.args = { hideDate: false, }; SystemActivity.parameters = { docs: { description: { story: 'An ActivityItem generated by Sentry', }, }, }; export const Bubble = ({...args}) => (
Activity Bubble
Activity Bubble
Activity Bubble
Activity Bubble
Activity Bubble
); Bubble.component = ActivityBubble; Bubble.args = { backgroundColor: '#fff', borderColor: 'red', }; Bubble.argTypes = { backgroundColor: {control: 'color'}, borderColor: {control: 'color'}, }; Bubble.parameters = { docs: { description: { story: 'Activity bubble with arrow at the top-left. This should probably not be used directly unless creating a new component.', }, }, }; export const Avatar = () => (

User

System

); Avatar.parameters = { docs: { description: { story: 'Avatar based on the author type.', }, }, };