Skip to content

Commit 54e5acb

Browse files
authored
Merge pull request Expensify#68043 from lorretheboy/fix/67603
Check and then remove unnecessary overflow menu in Create Expense
2 parents dd11c95 + 3d6e590 commit 54e5acb

2 files changed

Lines changed: 3 additions & 25 deletions

File tree

src/components/MoneyRequestConfirmationListFooter.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {convertToDisplayString} from '@libs/CurrencyUtils';
1414
import DistanceRequestUtils from '@libs/DistanceRequestUtils';
1515
import Navigation from '@libs/Navigation/Navigation';
1616
import {getDestinationForDisplay, getSubratesFields, getSubratesForDisplay, getTimeDifferenceIntervals, getTimeForDisplay} from '@libs/PerDiemRequestUtils';
17-
import {canSendInvoice, getPerDiemCustomUnit, isPaidGroupPolicy} from '@libs/PolicyUtils';
17+
import {canSendInvoice, getPerDiemCustomUnit} from '@libs/PolicyUtils';
1818
import type {ThumbnailAndImageURI} from '@libs/ReceiptUtils';
1919
import {getThumbnailAndImageURIs} from '@libs/ReceiptUtils';
2020
import {
@@ -321,8 +321,7 @@ function MoneyRequestConfirmationListFooter({
321321
// Determine if the merchant error should be displayed
322322
const shouldDisplayMerchantError = isMerchantRequired && (shouldDisplayFieldError || formError === 'iou.error.invalidMerchant') && isMerchantEmpty;
323323
const shouldDisplayDistanceRateError = formError === 'iou.error.invalidRate';
324-
// The empty receipt component should only show for IOU Requests of a paid policy ("Team" or "Corporate")
325-
const shouldShowReceiptEmptyState = iouType === CONST.IOU.TYPE.SUBMIT && isPaidGroupPolicy(policy) && !isPerDiemRequest;
324+
const shouldShowReceiptEmptyState = (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.TRACK) && !isPerDiemRequest;
326325
// The per diem custom unit
327326
const perDiemCustomUnit = getPerDiemCustomUnit(policy);
328327
const {

src/pages/iou/request/step/IOURequestStepConfirmation.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import useOnyx from '@hooks/useOnyx';
2222
import usePermissions from '@hooks/usePermissions';
2323
import useTheme from '@hooks/useTheme';
2424
import useThemeStyles from '@hooks/useThemeStyles';
25-
import useThreeDotsAnchorPosition from '@hooks/useThreeDotsAnchorPosition';
2625
import {completeTestDriveTask} from '@libs/actions/Task';
2726
import DateUtils from '@libs/DateUtils';
2827
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
@@ -149,7 +148,6 @@ function IOURequestStepConfirmation({
149148
const theme = useTheme();
150149
const {translate} = useLocalize();
151150
const {isBetaEnabled} = usePermissions();
152-
const threeDotsAnchorPosition = useThreeDotsAnchorPosition(styles.threeDotsPopoverOffsetNoCloseButton);
153151
const {isOffline} = useNetwork();
154152
const [startLocationPermissionFlow, setStartLocationPermissionFlow] = useState(false);
155153
const [selectedParticipantList, setSelectedParticipantList] = useState<Participant[]>([]);
@@ -368,10 +366,6 @@ function IOURequestStepConfirmation({
368366
backTo,
369367
]);
370368

371-
const navigateToAddReceipt = useCallback(() => {
372-
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(action, iouType, initialTransactionID, reportID, Navigation.getActiveRouteWithoutParams()));
373-
}, [iouType, initialTransactionID, reportID, action]);
374-
375369
// When the component mounts, if there is a receipt, see if the image can be read from the disk. If not, redirect the user to the starting step of the flow.
376370
// This is because until the request is saved, the receipt file is only stored in the browsers memory as a blob:// and if the browser is refreshed, then
377371
// the image ceases to exist. The best way for the user to recover from this is to start over from the start of the request process.
@@ -1015,9 +1009,6 @@ function IOURequestStepConfirmation({
10151009
showPreviousTransaction();
10161010
};
10171011

1018-
const shouldShowThreeDotsButton =
1019-
requestType === CONST.IOU.REQUEST_TYPE.MANUAL && (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.TRACK) && !isMovingTransactionFromTrackExpense;
1020-
10211012
const shouldShowSmartScanFields =
10221013
!!transaction?.receipt?.isTestDriveReceipt || (isMovingTransactionFromTrackExpense ? transaction?.amount !== 0 : requestType !== CONST.IOU.REQUEST_TYPE.SCAN);
10231014

@@ -1027,24 +1018,12 @@ function IOURequestStepConfirmation({
10271018
testID={IOURequestStepConfirmation.displayName}
10281019
headerGapStyles={isDraggingOver ? [styles.dropWrapper] : []}
10291020
>
1030-
<DragAndDropProvider
1031-
setIsDraggingOver={setIsDraggingOver}
1032-
isDisabled={!shouldShowThreeDotsButton}
1033-
>
1021+
<DragAndDropProvider setIsDraggingOver={setIsDraggingOver}>
10341022
<View style={styles.flex1}>
10351023
<HeaderWithBackButton
10361024
title={headerTitle}
10371025
subtitle={hasMultipleTransactions ? `${currentTransactionIndex + 1} ${translate('common.of')} ${transactions.length}` : undefined}
10381026
onBackButtonPress={navigateBack}
1039-
shouldShowThreeDotsButton={shouldShowThreeDotsButton}
1040-
threeDotsAnchorPosition={threeDotsAnchorPosition}
1041-
threeDotsMenuItems={[
1042-
{
1043-
icon: Expensicons.Receipt,
1044-
text: translate('receipt.addReceipt'),
1045-
onSelected: navigateToAddReceipt,
1046-
},
1047-
]}
10481027
shouldDisplayHelpButton={!hasMultipleTransactions}
10491028
>
10501029
{hasMultipleTransactions ? (

0 commit comments

Comments
 (0)