diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index 46c3ad18a635..dce7373c54bb 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -59,6 +59,7 @@ function ButtonWithDropdownMenu({ // eslint-disable-next-line react-compiler/react-compiler const dropdownButtonRef = isSplitButton ? buttonRef : mergeRefs(buttonRef, dropdownAnchor); const selectedItem = options.at(selectedItemIndex) ?? options.at(0); + const areAllOptionsDisabled = options.every((option) => option.disabled); const innerStyleDropButton = StyleUtils.getDropDownButtonHeight(buttonSize); const isButtonSizeLarge = buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE; const nullCheckRef = (ref: MutableRefObject) => ref ?? null; @@ -130,7 +131,7 @@ function ButtonWithDropdownMenu({ ref={dropdownButtonRef} onPress={handlePress} text={customText ?? selectedItem?.text ?? ''} - isDisabled={isDisabled || !!selectedItem?.disabled} + isDisabled={isDisabled || areAllOptionsDisabled} isLoading={isLoading} shouldRemoveRightBorderRadius style={isSplitButton ? [styles.flex1, styles.pr0] : {}} diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 9b030f9bfede..b1f9d47ec095 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -146,7 +146,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea const policyType = policy?.type; const connectedIntegration = getConnectedIntegration(policy); const navigateBackToAfterDelete = useRef(); - const hasHeldExpenses = hasHeldExpensesReportUtils(moneyRequestReport?.reportID); const hasScanningReceipt = getTransactionsWithReceipts(moneyRequestReport?.reportID).some((t) => isReceiptBeingScanned(t)); const hasOnlyPendingTransactions = useMemo(() => { return !!transactions && transactions.length > 0 && transactions.every((t) => isExpensifyCardTransaction(t) && isPending(t)); @@ -377,7 +376,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea {shouldShowSettlementButton && !shouldUseNarrowLayout && ( {shouldShowSettlementButton && ( = type ActionCellProps = { action?: SearchTransactionAction; - shouldUseSuccessStyle?: boolean; isLargeScreenWidth?: boolean; isSelected?: boolean; goToItem: () => void; @@ -36,7 +35,6 @@ type ActionCellProps = { function ActionCell({ action = CONST.SEARCH.ACTION_TYPES.VIEW, - shouldUseSuccessStyle: shouldUseSuccessStyleProp = true, isLargeScreenWidth = true, isSelected = false, goToItem, @@ -51,17 +49,6 @@ function ActionCell({ const {isOffline} = useNetwork(); const text = isChildListItem ? translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]) : translate(actionTranslationsMap[action]); - - const getButtonInnerStyles = useCallback( - (shouldUseSuccessStyle: boolean) => { - if (!isSelected) { - return {}; - } - return shouldUseSuccessStyle ? styles.buttonSuccessHovered : styles.buttonDefaultHovered; - }, - [isSelected, styles], - ); - const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || (parentAction === CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID); if ((parentAction !== CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || action === CONST.SEARCH.ACTION_TYPES.DONE) { @@ -88,13 +75,15 @@ function ActionCell({ } if (action === CONST.SEARCH.ACTION_TYPES.VIEW || action === CONST.SEARCH.ACTION_TYPES.REVIEW || shouldUseViewAction) { + const buttonInnerStyles = isSelected ? styles.buttonDefaultSelected : {}; + return isLargeScreenWidth ? (