Skip to content

Commit

Permalink
add conditional prop
Browse files Browse the repository at this point in the history
  • Loading branch information
twilight2294 authored Nov 26, 2024
1 parent faa4377 commit fd6e738
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ type MenuItemBaseProps = {

/** Should use auto width for the icon container. */
shouldIconUseAutoWidthStyle?: boolean;

/** Should break word for room title */
shouldBreakWord?: boolean;
};

type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps;
Expand Down Expand Up @@ -444,6 +447,7 @@ function MenuItem(
shouldShowSelectedItemCheck = false,
onHideTooltip,
shouldIconUseAutoWidthStyle = false,
shouldBreakWord = false,
}: MenuItemProps,
ref: PressableRef,
) {
Expand All @@ -469,7 +473,7 @@ function MenuItem(
interactive && disabled ? {...styles.userSelectNone} : {},
styles.ltr,
isDeleted ? styles.offlineFeedback.deleted : {},
styles.breakWord,
shouldBreakWord ? styles.breakWord : {},
],
titleStyle ?? {},
);
Expand Down

0 comments on commit fd6e738

Please sign in to comment.