diff --git a/assets/images/checkmark-circle.svg b/assets/images/checkmark-circle.svg
new file mode 100644
index 000000000000..3497548bc1bc
--- /dev/null
+++ b/assets/images/checkmark-circle.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/components/Icon/Expensicons.ts b/src/components/Icon/Expensicons.ts
index 7e81f5ba3814..4dfbd891d9f6 100644
--- a/src/components/Icon/Expensicons.ts
+++ b/src/components/Icon/Expensicons.ts
@@ -38,6 +38,7 @@ import ChatBubbleUnread from '@assets/images/chatbubble-unread.svg';
import ChatBubble from '@assets/images/chatbubble.svg';
import ChatBubbles from '@assets/images/chatbubbles.svg';
import CheckCircle from '@assets/images/check-circle.svg';
+import CheckmarkCircle from '@assets/images/checkmark-circle.svg';
import Checkmark from '@assets/images/checkmark.svg';
import Close from '@assets/images/close.svg';
import ClosedSign from '@assets/images/closed-sign.svg';
@@ -350,4 +351,5 @@ export {
DocumentPlus,
Clear,
CheckCircle,
+ CheckmarkCircle,
};
diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx
index b6f378763659..0fcc12ec50e0 100644
--- a/src/components/MenuItem.tsx
+++ b/src/components/MenuItem.tsx
@@ -360,7 +360,7 @@ function MenuItem(
const theme = useTheme();
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
- const combinedStyle = [style, styles.popoverMenuItem];
+ const combinedStyle = [styles.popoverMenuItem, style];
const {shouldUseNarrowLayout} = useResponsiveLayout();
const {isExecuting, singleExecution, waitForNavigate} = useContext(MenuItemGroupContext) ?? {};
diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx
index 04fbbe616458..ec52a6158ad7 100644
--- a/src/components/MoneyReportHeader.tsx
+++ b/src/components/MoneyReportHeader.tsx
@@ -104,7 +104,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
const shouldDisableApproveButton = shouldShowApproveButton && !ReportUtils.isAllowedToApproveExpenseReport(moneyRequestReport);
- const shouldShowSettlementButton = !ReportUtils.isInvoiceReport(moneyRequestReport) && (shouldShowPayButton || shouldShowApproveButton) && !allHavePendingRTERViolation;
+ const shouldShowSettlementButton = (shouldShowPayButton || shouldShowApproveButton) && !allHavePendingRTERViolation;
const shouldShowSubmitButton = isDraft && reimbursableSpend !== 0 && !allHavePendingRTERViolation;
const shouldDisableSubmitButton = shouldShowSubmitButton && !ReportUtils.isAllowedToSubmitDraftExpenseReport(moneyRequestReport);
@@ -120,14 +120,16 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
const isMoreContentShown = shouldShowNextStep || hasScanningReceipt || (shouldShowAnyButton && shouldUseNarrowLayout);
const confirmPayment = (type?: PaymentMethodType | undefined) => {
- if (!type) {
+ if (!type || !chatReport) {
return;
}
setPaymentType(type);
setRequestType('pay');
if (ReportUtils.hasHeldExpenses(moneyRequestReport.reportID)) {
setIsHoldMenuVisible(true);
- } else if (chatReport) {
+ } else if (ReportUtils.isInvoiceReport(moneyRequestReport)) {
+ IOU.payInvoice(type, chatReport, moneyRequestReport);
+ } else {
IOU.payMoneyRequest(type, chatReport, moneyRequestReport, true);
}
};
diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx
index e525d07fa1d3..0bdf83bf4f27 100644
--- a/src/components/PopoverMenu.tsx
+++ b/src/components/PopoverMenu.tsx
@@ -1,3 +1,4 @@
+import lodashIsEqual from 'lodash/isEqual';
import type {RefObject} from 'react';
import React, {useEffect, useRef, useState} from 'react';
import {View} from 'react-native';
@@ -5,6 +6,7 @@ import type {ModalProps} from 'react-native-modal';
import useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
+import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import type {AnchorPosition} from '@src/styles';
@@ -26,6 +28,9 @@ type PopoverMenuItem = MenuItemProps & {
/** Sub menu items to be rendered after a menu item is selected */
subMenuItems?: PopoverMenuItem[];
+ /** Back button text to be shown if sub menu items are opened */
+ backButtonText?: string;
+
/** Determines whether the menu item is disabled or not */
disabled?: boolean;
};
@@ -98,6 +103,7 @@ function PopoverMenu({
shouldEnableNewFocusManagement,
}: PopoverMenuProps) {
const styles = useThemeStyles();
+ const theme = useTheme();
const {isSmallScreenWidth} = useResponsiveLayout();
const selectedItemIndex = useRef(null);
@@ -111,6 +117,7 @@ function PopoverMenu({
if (selectedItem?.subMenuItems) {
setCurrentMenuItems([...selectedItem.subMenuItems]);
setEnteredSubMenuIndexes([...enteredSubMenuIndexes, index]);
+ setFocusedIndex(-1);
} else {
selectedItemIndex.current = index;
onItemSelected(selectedItem, index);
@@ -132,17 +139,22 @@ function PopoverMenu({
const renderBackButtonItem = () => {
const previousMenuItems = getPreviousSubMenu();
const previouslySelectedItem = previousMenuItems[enteredSubMenuIndexes[enteredSubMenuIndexes.length - 1]];
+ const hasBackButtonText = !!previouslySelectedItem.backButtonText;
return (