From 92e5979362c51d4439567192d89350138d330518 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 25 Sep 2024 18:42:22 +0800 Subject: [PATCH] use same height with or without avatar --- src/components/ReportActionItem/TaskPreview.tsx | 5 +++-- src/styles/utils/index.ts | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx index 4b45dde53c23..00b02f6ec522 100644 --- a/src/components/ReportActionItem/TaskPreview.tsx +++ b/src/components/ReportActionItem/TaskPreview.tsx @@ -74,8 +74,9 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che const taskAssigneeAccountID = Task.getTaskAssigneeAccountID(taskReport) ?? action?.childManagerAccountID ?? -1; const personalDetails = usePersonalDetails(); const avatar = personalDetails?.[taskAssigneeAccountID]?.avatar ?? Expensicons.FallbackAvatar; + const avatarSize = CONST.AVATAR_SIZE.SMALL; const isDeletedParentAction = ReportUtils.isCanceledTaskReport(taskReport, action); - const iconWrapperStyle = StyleUtils.getTaskPreviewIconWrapper(taskAssigneeAccountID > 0); + const iconWrapperStyle = StyleUtils.getTaskPreviewIconWrapper(avatarSize); if (isDeletedParentAction) { return ${translate('parentReportAction.deletedTask')}`} />; @@ -113,7 +114,7 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 0564c836b877..6d398e37f5d7 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1669,10 +1669,9 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({ justifyContent: 'center', }), - getTaskPreviewIconWrapper: (hasAvatar: boolean) => { - const height = hasAvatar ? getAvatarSize(CONST.AVATAR_SIZE.SMALL) : variables.fontSizeNormalHeight; + getTaskPreviewIconWrapper: (avatarSize: AvatarSizeName) => { return { - height, + height: getAvatarSize(avatarSize), ...styles.justifyContentCenter, }; },