Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/components/AccountSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function AccountSwitcher({isScreenFocused}: AccountSwitcherProps) {
icon: personalDetails?.avatar ?? '',
iconType: CONST.ICON_TYPE_AVATAR,
outerWrapperStyle: shouldUseNarrowLayout ? {} : styles.accountSwitcherPopover,
shouldIgnoreCompactStyle: true,
numberOfLinesDescription: 1,
errorText: error ?? '',
shouldShowRedDotIndicator: !!error,
Expand Down
3 changes: 3 additions & 0 deletions src/components/ButtonWithDropdownMenu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type DropdownOption<TValueType> = WithSentryLabel & {
shouldShowLoadingSpinnerIcon?: boolean;
/** The type of brick road indicator to show */
brickRoadIndicator?: ValueOf<typeof CONST.BRICK_ROAD_INDICATOR_STATUS>;

/** Whether to ignore compact popover menu styling for this item */
shouldIgnoreCompactStyle?: boolean;
};

type ButtonWithDropdownMenuProps<TValueType> = WithSentryLabel & {
Expand Down
13 changes: 11 additions & 2 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ type MenuItemBaseProps = ForwardedFSClassProps &

/** Additional styles for the right icon wrapper */
rightIconWrapperStyle?: StyleProp<ViewStyle>;

/** Whether to ignore compact popover menu styling for this item */
shouldIgnoreCompactStyle?: boolean;
};

type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps;
Expand Down Expand Up @@ -606,6 +609,7 @@ function MenuItem({
tabIndex = 0,
rightIconWrapperStyle,
titleAccessibilityRole,
shouldIgnoreCompactStyle = false,
}: MenuItemProps) {
const icons = useMemoizedLazyExpensifyIcons(['ArrowRight', 'FallbackAvatar', 'DotIndicator', 'Checkmark', 'NewWindow']);
const {translate} = useLocalize();
Expand All @@ -620,11 +624,16 @@ function MenuItem({
const popoverAnchor = useRef<View>(null);
const deviceHasHoverSupport = hasHoverSupport();
const isCompactMenu = useIsCompactMenu();
const isCompactPopoverItem = isCompactMenu && !isSmallScreenWidth;
const isCompactPopoverItem = isCompactMenu && !isSmallScreenWidth && !shouldIgnoreCompactStyle;
const compactIconStyle = isCompactPopoverItem && iconType === CONST.ICON_TYPE_ICON && {width: variables.iconSizeNormal};
const isCompact = viewMode === CONST.OPTION_MODE.COMPACT;
const isDeleted = style && Array.isArray(style) ? style.includes(styles.offlineFeedbackDeleted) : false;
const descriptionVerticalMargin = shouldShowDescriptionOnTop ? styles.mb1 : styles.mt1;
let descriptionVerticalMargin: ViewStyle = styles.mt1;
if (shouldShowDescriptionOnTop) {
descriptionVerticalMargin = styles.mb1;
} else if (isCompactPopoverItem) {
descriptionVerticalMargin = styles.mt0Half;
}
const menuItemLoadingReasonAttributes: SkeletonSpanReasonAttributes = {
context: 'MenuItem',
};
Expand Down
1 change: 1 addition & 0 deletions src/components/SettlementButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ function SettlementButton({
iconHeight: typeof account.icon === 'number' ? undefined : account.iconSize,
value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
description: account.description,
shouldIgnoreCompactStyle: true,
onSelected: () => {
if (checkForNecessaryAction(CONST.IOU.PAYMENT_TYPE.VBBA)) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useBulkPayOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function useBulkPayOptions({
iconHeight: typeof account.icon === 'number' ? undefined : account.iconSize,
key: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
shouldIgnoreKeyForRendering: true,
shouldIgnoreCompactStyle: true,
additionalData: {
bankAccountID: account.methodID,
paymentMethod: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
Expand Down
1 change: 1 addition & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const webViewStyles = (theme: ThemeColors) =>
const compactPopoverMenuItemBaseStyle = {
...spacing.ph5,
...spacing.pv1,
minHeight: variables.componentSizeLarge,
alignItems: 'center' as const,
};

Expand Down
Loading