Skip to content

Commit

Permalink
use same height with or without avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Sep 25, 2024
1 parent 7875e1d commit 92e5979
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/ReportActionItem/TaskPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <RenderHTML html={`<comment>${translate('parentReportAction.deletedTask')}</comment>`} />;
Expand Down Expand Up @@ -113,7 +114,7 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che
<Avatar
containerStyles={[styles.mr2, isTaskCompleted ? styles.opacitySemiTransparent : undefined]}
source={avatar}
size={CONST.AVATAR_SIZE.SMALL}
size={avatarSize}
avatarID={taskAssigneeAccountID}
type={CONST.ICON_TYPE_AVATAR}
/>
Expand Down
5 changes: 2 additions & 3 deletions src/styles/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
},
Expand Down

0 comments on commit 92e5979

Please sign in to comment.