Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the height of the LHN navigation items from 56px to 52px. #51169

Merged
merged 19 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bfa31db
changed sectionMenuItem height from 56px to 52px
jayeshmangwani Oct 21, 2024
5f1b91f
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 21, 2024
342dfba
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 22, 2024
92954fb
removed default width(40) and used widthAuto for popoverMenuIcon
jayeshmangwani Oct 22, 2024
34aa9cd
increased sectionMenuItem horizontal padding from 8px to 16px
jayeshmangwani Oct 22, 2024
41d2deb
increased popoverMenuItem vertical padding to 16px
jayeshmangwani Oct 22, 2024
da3de7b
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 22, 2024
e15fe53
added shouldUseAutoWidth prop for handling the default 40 width for t…
jayeshmangwani Oct 22, 2024
78c1533
prettier fix
jayeshmangwani Oct 22, 2024
7d877c2
fixed lint
jayeshmangwani Oct 22, 2024
4bcf684
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 22, 2024
1a406ce
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 23, 2024
27316eb
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 23, 2024
ec4ad10
changed prop for default width to shouldIconUseAutoWidthStyle
jayeshmangwani Oct 23, 2024
b2d14a1
changed paddingVertical to 8 for sectionMenuItem
jayeshmangwani Oct 23, 2024
c4ebb0f
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 23, 2024
4bd1196
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 24, 2024
56636e7
Merge branch 'main' into sectionMenuItemHeightTo52px
jayeshmangwani Oct 24, 2024
7a506fa
added auto width to search three dot menu
jayeshmangwani Oct 24, 2024
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
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
Loading