Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,9 @@ function MenuItem({
});
const shouldDimIconRight = iconRight === icons.ArrowRight || !iconRight;

const hasIcon = (!!icon || iconType === CONST.ICON_TYPE_WORKSPACE) && !Array.isArray(icon);
// eslint-disable-next-line no-nested-ternary -- Selects ml2/ml3/empty based on icon presence and avatar size
const iconLeftPadding = shouldPutLeftPaddingWhenNoIcon || (icon && !Array.isArray(icon)) ? (avatarSize === CONST.AVATAR_SIZE.SMALL ? styles.ml2 : styles.ml3) : {};
const iconLeftPadding = shouldPutLeftPaddingWhenNoIcon || hasIcon ? (avatarSize === CONST.AVATAR_SIZE.SMALL ? styles.ml2 : styles.ml3) : {};

const combinedTitleTextStyle = StyleUtils.combineStyles<TextStyle>(
[
Expand All @@ -707,7 +708,7 @@ function MenuItem({
styles.flex1,
title ? {} : StyleUtils.getFontSizeStyle(variables.fontSizeNormal),
title ? styles.textLineHeightNormal : StyleUtils.getLineHeightStyle(variables.fontSizeNormalHeight),
!descriptionAddon && icon && !Array.isArray(icon) ? styles.ml3 : {},
!descriptionAddon && hasIcon ? styles.ml3 : {},
descriptionAddon ? styles.ml2 : {},
(descriptionTextStyle as TextStyle) || styles.breakWord,
isDeleted ? styles.offlineFeedbackDeleted : {},
Expand All @@ -716,7 +717,7 @@ function MenuItem({
const descriptionContainerStyle = StyleUtils.combineStyles<ViewStyle>([
styles.flexRow,
styles.alignItemsCenter,
descriptionAddon && icon && !Array.isArray(icon) ? styles.ml3 : {},
descriptionAddon && hasIcon ? styles.ml3 : {},
title ? descriptionVerticalMargin : {},
]);

Expand Down Expand Up @@ -959,7 +960,7 @@ function MenuItem({
]}
/>
)}
{(!!icon || iconType === CONST.ICON_TYPE_WORKSPACE) && !Array.isArray(icon) && (
{hasIcon && (
<View
style={[
styles.popoverMenuIcon,
Expand Down
Loading