Skip to content

Commit

Permalink
Merge pull request #51169 from jayeshmangwani/sectionMenuItemHeightTo…
Browse files Browse the repository at this point in the history
…52px

Updated the height of the LHN navigation items from 56px to 52px.
  • Loading branch information
rafecolton authored Oct 24, 2024
2 parents 8807b2b + 7a506fa commit 26e1d2d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
20 changes: 18 additions & 2 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ type MenuItemBaseProps = {

/** Handles what to do when hiding the tooltip */
onHideTooltip?: () => void;

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

type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps;
Expand Down Expand Up @@ -432,6 +435,7 @@ function MenuItem(
renderTooltipContent,
shouldShowSelectedItemCheck = false,
onHideTooltip,
shouldIconUseAutoWidthStyle = false,
}: MenuItemProps,
ref: PressableRef,
) {
Expand Down Expand Up @@ -623,10 +627,22 @@ function MenuItem(
/>
)}
{!icon && shouldPutLeftPaddingWhenNoIcon && (
<View style={[styles.popoverMenuIcon, iconStyles, StyleUtils.getAvatarWidthStyle(avatarSize)]} />
<View
style={[
styles.popoverMenuIcon,
iconStyles,
shouldIconUseAutoWidthStyle ? styles.wAuto : StyleUtils.getAvatarWidthStyle(avatarSize),
]}
/>
)}
{icon && !Array.isArray(icon) && (
<View style={[styles.popoverMenuIcon, iconStyles, StyleUtils.getAvatarWidthStyle(avatarSize)]}>
<View
style={[
styles.popoverMenuIcon,
iconStyles,
shouldIconUseAutoWidthStyle ? styles.wAuto : StyleUtils.getAvatarWidthStyle(avatarSize),
]}
>
{typeof icon !== 'string' &&
iconType === CONST.ICON_TYPE_ICON &&
(!shouldShowLoadingSpinnerIcon ? (
Expand Down
1 change: 1 addition & 0 deletions src/pages/Search/SavedSearchItemThreeDotMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function SavedSearchItemThreeDotMenu({menuItems, isDisabledItem}: SavedSearchIte
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
iconStyles={styles.wAuto}
/>
</View>
);
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Search/SearchTypeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function SearchTypeMenu({queryJSON, searchName}: SearchTypeMenuProps) {
styles: [styles.alignItemsCenter],
pendingAction: item.pendingAction,
disabled: item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
shouldIconUseAutoWidthStyle: true,
};

if (!isNarrow) {
Expand Down Expand Up @@ -255,6 +256,7 @@ function SearchTypeMenu({queryJSON, searchName}: SearchTypeMenuProps) {
wrapperStyle={styles.sectionMenuItem}
focused={index === activeItemIndex}
onPress={onPress}
shouldIconUseAutoWidthStyle
/>
);
})}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
}
iconRight={item.iconRight}
shouldShowRightIcon={item.shouldShowRightIcon}
shouldIconUseAutoWidthStyle
/>
);
})}
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
highlighted={enabledItem?.routeName === item.routeName}
focused={!!(item.routeName && activeRoute?.startsWith(item.routeName))}
badgeText={item.badgeText}
shouldIconUseAutoWidthStyle
/>
))}
</View>
Expand Down
5 changes: 3 additions & 2 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2902,8 +2902,9 @@ const styles = (theme: ThemeColors) =>

sectionMenuItem: {
borderRadius: 8,
paddingHorizontal: 8,
height: 56,
paddingHorizontal: 16,
paddingVertical: 8,
height: 52,
alignItems: 'center',
},

Expand Down

0 comments on commit 26e1d2d

Please sign in to comment.