Skip to content

Commit

Permalink
Merge pull request #42364 from ShridharGoel/42007
Browse files Browse the repository at this point in the history
Hold request education details should show suitably for new search on web
  • Loading branch information
aldo-expensify authored May 29, 2024
2 parents 2a7d5d4 + 59a9b31 commit 0719766
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
const isApproved = ReportUtils.isReportApproved(moneyRequestReport);
const isDraft = ReportUtils.isOpenExpenseReport(moneyRequestReport);
const isOnHold = TransactionUtils.isOnHold(transaction);
const {windowWidth} = useWindowDimensions();
const {isSmallScreenWidth, windowWidth} = useWindowDimensions();

// Only the requestor can take delete the expense, admins can only edit it.
const isActionOwner = typeof parentReportAction?.actorAccountID === 'number' && typeof session?.accountID === 'number' && parentReportAction.actorAccountID === session?.accountID;
Expand Down Expand Up @@ -179,14 +179,14 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
return;
}

if (shouldUseNarrowLayout) {
if (isSmallScreenWidth) {
if (Navigation.getActiveRoute().slice(1) === ROUTES.PROCESS_MONEY_REQUEST_HOLD) {
Navigation.goBack();
}
} else {
Navigation.navigate(ROUTES.PROCESS_MONEY_REQUEST_HOLD);
}
}, [shouldUseNarrowLayout, shouldShowHoldMenu]);
}, [isSmallScreenWidth, shouldShowHoldMenu]);

const handleHoldRequestClose = () => {
IOU.setShownHoldUseExplanation();
Expand Down Expand Up @@ -259,7 +259,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
cancelText={translate('common.cancel')}
danger
/>
{shouldUseNarrowLayout && shouldShowHoldMenu && (
{isSmallScreenWidth && shouldShowHoldMenu && (
<ProcessMoneyRequestHoldMenu
onClose={handleHoldRequestClose}
onConfirm={handleHoldRequestClose}
Expand Down

0 comments on commit 0719766

Please sign in to comment.