diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 1acee187c67b..0c0b71ac7766 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -377,7 +377,6 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea nonHeldAmount={!hasOnlyHeldExpenses ? nonHeldAmount : undefined} requestType={requestType} fullAmount={fullAmount} - isSmallScreenWidth={shouldUseNarrowLayout} onClose={() => setIsHoldMenuVisible(false)} isVisible={isHoldMenuVisible} paymentType={paymentType} diff --git a/src/components/ProcessMoneyReportHoldMenu.tsx b/src/components/ProcessMoneyReportHoldMenu.tsx index 872464d8a5b0..4afa7aa4972c 100644 --- a/src/components/ProcessMoneyReportHoldMenu.tsx +++ b/src/components/ProcessMoneyReportHoldMenu.tsx @@ -1,6 +1,7 @@ import React, {useMemo} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; +import useResponsiveLayout from '@hooks/useResponsiveLayout'; import Navigation from '@libs/Navigation/Navigation'; import {isLinkedTransactionHeld} from '@libs/ReportActionsUtils'; import * as IOU from '@userActions/IOU'; @@ -20,9 +21,6 @@ type ProcessMoneyReportHoldMenuProps = { /** Full amount of expense report to pay */ fullAmount: string; - /** Is the window width narrow, like on a mobile device? */ - isSmallScreenWidth: boolean; - /** Whether modal is visible */ isVisible: boolean; @@ -49,7 +47,6 @@ function ProcessMoneyReportHoldMenu({ requestType, nonHeldAmount, fullAmount, - isSmallScreenWidth = false, onClose, isVisible, paymentType, @@ -59,6 +56,7 @@ function ProcessMoneyReportHoldMenu({ }: ProcessMoneyReportHoldMenuProps) { const {translate} = useLocalize(); const isApprove = requestType === CONST.IOU.REPORT_ACTION_TYPE.APPROVE; + const {isSmallScreenWidth} = useResponsiveLayout(); const onSubmit = (full: boolean) => { if (isApprove) { diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index ae6ace23c64e..91b1d30ab51a 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -19,7 +19,6 @@ import useNetwork from '@hooks/useNetwork'; import usePermissions from '@hooks/usePermissions'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import useWindowDimensions from '@hooks/useWindowDimensions'; import ControlSelection from '@libs/ControlSelection'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; @@ -131,7 +130,6 @@ function ReportPreview({ const [requestType, setRequestType] = useState(); const [nonHeldAmount, fullAmount] = ReportUtils.getNonHeldAndFullAmount(iouReport, policy); const hasOnlyHeldExpenses = ReportUtils.hasOnlyHeldExpenses(iouReport?.reportID ?? ''); - const {isSmallScreenWidth} = useWindowDimensions(); const [paymentType, setPaymentType] = useState(); const managerID = iouReport?.managerID ?? action.childManagerAccountID ?? 0; @@ -478,7 +476,6 @@ function ReportPreview({ nonHeldAmount={!hasOnlyHeldExpenses ? nonHeldAmount : undefined} requestType={requestType} fullAmount={fullAmount} - isSmallScreenWidth={isSmallScreenWidth} onClose={() => setIsHoldMenuVisible(false)} isVisible={isHoldMenuVisible} paymentType={paymentType}