diff --git a/static/app/views/issueDetails/activitySection/groupActivityIcons.tsx b/static/app/views/issueDetails/activitySection/groupActivityIcons.tsx index 779ce980fade..3d00b2f02d4d 100644 --- a/static/app/views/issueDetails/activitySection/groupActivityIcons.tsx +++ b/static/app/views/issueDetails/activitySection/groupActivityIcons.tsx @@ -44,12 +44,12 @@ import {GroupActivityType} from 'sentry/types/group'; interface IconWithDefaultProps { Component: React.ComponentType | null; defaultProps: {locked?: boolean; type?: string}; - componentFunction?: (props: { + propsFunction?: (data: GroupActivity['data']) => Record; + renderIcon?: (props: { data: GroupActivity['data']; sentry_app: GroupActivity['sentry_app']; user: GroupActivity['user']; - }) => React.ComponentType; - propsFunction?: (data: GroupActivity['data']) => Record; + }) => React.ReactNode; } export const groupActivityTypeIconMapping: Record< @@ -59,13 +59,11 @@ export const groupActivityTypeIconMapping: Record< [GroupActivityType.NOTE]: { Component: IconChat, defaultProps: {}, - componentFunction: ({user, sentry_app}) => { + renderIcon: ({user, sentry_app}) => { if (sentry_app) { - return function () { - return ; - }; + return ; } - return user ? () => : IconChat; + return user ? : ; }, }, [GroupActivityType.SET_RESOLVED]: {Component: IconCheckmark, defaultProps: {}}, @@ -109,21 +107,21 @@ export const groupActivityTypeIconMapping: Record< [GroupActivityType.SET_REGRESSION]: {Component: IconFire, defaultProps: {}}, [GroupActivityType.CREATE_ISSUE]: { Component: IconAdd, - componentFunction: ({data}) => { + renderIcon: ({data}) => { const provider = (data as GroupActivityCreateIssue['data']).provider; switch (provider) { case 'GitHub': - return IconGithub; + return ; case 'GitLab': - return IconGitlab; + return ; case 'Bitbucket': - return IconBitbucket; + return ; case 'Jira': - return IconJira; + return ; case 'Asana': - return IconAsana; + return ; default: - return IconAdd; + return ; } }, defaultProps: {}, diff --git a/static/app/views/issueDetails/activitySection/index.tsx b/static/app/views/issueDetails/activitySection/index.tsx index a85dd8c426d3..70a55ed421b7 100644 --- a/static/app/views/issueDetails/activitySection/index.tsx +++ b/static/app/views/issueDetails/activitySection/index.tsx @@ -134,14 +134,20 @@ function LegacyTimelineItem({ ); const iconMapping = groupActivityTypeIconMapping[item.type]; - const componentFunction = iconMapping?.componentFunction; - const Icon = componentFunction - ? componentFunction({ + const Icon = iconMapping?.Component ?? null; + const iconNode = iconMapping?.renderIcon + ? iconMapping.renderIcon({ data: item.data, user: item.user, sentry_app: item.sentry_app, }) - : (iconMapping?.Component ?? null); + : Icon && ( + + ); return ( } timestamp={} - icon={ - Icon && ( - - ) - } + icon={iconNode} > {item.type === GroupActivityType.NOTE && editing ? ( + ); return ( } marker={} colorConfig={colorConfig} - icon={ - Icon && ( - - ) - } + icon={iconNode} > {typeof message === 'string' ? (