From 7fa8b43451f6ab5d1c343dc93e8f014f199613f6 Mon Sep 17 00:00:00 2001 From: jakubstec Date: Fri, 10 Apr 2026 11:01:53 +0200 Subject: [PATCH 1/3] fix: add scrollview and overwrite minHeight inside EmptyStateComponent for AddUnreportedExpense --- src/pages/AddUnreportedExpense.tsx | 63 +++++++++++++++++------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/src/pages/AddUnreportedExpense.tsx b/src/pages/AddUnreportedExpense.tsx index dd0aad315340..fbfba653ee40 100644 --- a/src/pages/AddUnreportedExpense.tsx +++ b/src/pages/AddUnreportedExpense.tsx @@ -4,6 +4,7 @@ import AddUnreportedExpenseFooter from '@components/AddUnreportedExpenseFooter'; import EmptyStateComponent from '@components/EmptyStateComponent'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; +import ScrollView from '@components/ScrollView'; import SelectionList from '@components/SelectionList'; import type {ListItem, SelectionListHandle} from '@components/SelectionList/types'; import UnreportedExpensesSkeleton from '@components/Skeletons/UnreportedExpensesSkeleton'; @@ -278,40 +279,48 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) { includeSafeAreaPaddingBottom shouldEnablePickerAvoiding={false} testID="NewChatSelectorPage" + enableEdgeToEdgeBottomSafeAreaPadding + shouldEnableMaxHeight focusTrapSettings={{active: false}} > - { - if ( - report && - report.policyID && - shouldRestrictUserBillableActions(report.policyID, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, undefined, policy) - ) { - Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(report.policyID)); - return; - } - interceptAnonymousUser(() => { - startMoneyRequest(CONST.IOU.TYPE.SUBMIT, reportID, draftTransactionIDs, undefined, false, backToReport); - }); + + { + if ( + report && + report.policyID && + shouldRestrictUserBillableActions(report.policyID, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, undefined, policy) + ) { + Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(report.policyID)); + return; + } + interceptAnonymousUser(() => { + startMoneyRequest(CONST.IOU.TYPE.SUBMIT, reportID, draftTransactionIDs, undefined, false, backToReport); + }); + }, + success: true, }, - success: true, - }, - ]} - /> + ]} + /> + ); } From 7d00da1a7e71cb6b90f90095f2f2db4a35a5cb5c Mon Sep 17 00:00:00 2001 From: jakubstec Date: Fri, 10 Apr 2026 11:55:40 +0200 Subject: [PATCH 2/3] remove unneccesary props, ensure minHeight is only set for landscape mode --- src/pages/AddUnreportedExpense.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pages/AddUnreportedExpense.tsx b/src/pages/AddUnreportedExpense.tsx index fbfba653ee40..c0e6fa4bb0d3 100644 --- a/src/pages/AddUnreportedExpense.tsx +++ b/src/pages/AddUnreportedExpense.tsx @@ -16,10 +16,12 @@ import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; import usePolicy from '@hooks/usePolicy'; import useThemeStyles from '@hooks/useThemeStyles'; +import useWindowDimensions from '@hooks/useWindowDimensions'; import {fetchUnreportedExpenses} from '@libs/actions/UnreportedExpenses'; import {convertToDisplayString} from '@libs/CurrencyUtils'; import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID'; import interceptAnonymousUser from '@libs/interceptAnonymousUser'; +import isInLandscapeMode from '@libs/isInLandscapeMode'; import type {AddUnreportedExpensesParamList} from '@libs/Navigation/types'; import {canSubmitPerDiemExpenseFromWorkspace, getPerDiemCustomUnit} from '@libs/PolicyUtils'; import {getTransactionDetails, isIOUReport} from '@libs/ReportUtils'; @@ -63,6 +65,7 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) { const [userBillingGracePeriodEnds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const shouldShowUnreportedTransactionsSkeletons = isLoadingUnreportedTransactions && hasMoreUnreportedTransactionsResults && !isOffline; const [draftTransactionIDs] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_DRAFT, {selector: validTransactionDraftIDsSelector}); + const {windowHeight, windowWidth} = useWindowDimensions(); const initialSkeletonReasonAttributes: SkeletonSpanReasonAttributes = { context: 'AddUnreportedExpense.InitialSkeleton', @@ -279,20 +282,15 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) { includeSafeAreaPaddingBottom shouldEnablePickerAvoiding={false} testID="NewChatSelectorPage" - enableEdgeToEdgeBottomSafeAreaPadding - shouldEnableMaxHeight focusTrapSettings={{active: false}} > - + Date: Fri, 10 Apr 2026 12:03:13 +0200 Subject: [PATCH 3/3] use useIsInLandscapeMode hook --- src/pages/AddUnreportedExpense.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/AddUnreportedExpense.tsx b/src/pages/AddUnreportedExpense.tsx index c0e6fa4bb0d3..2e79c3e55a4b 100644 --- a/src/pages/AddUnreportedExpense.tsx +++ b/src/pages/AddUnreportedExpense.tsx @@ -10,18 +10,17 @@ import type {ListItem, SelectionListHandle} from '@components/SelectionList/type import UnreportedExpensesSkeleton from '@components/Skeletons/UnreportedExpensesSkeleton'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useDebouncedState from '@hooks/useDebouncedState'; +import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode'; import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; import usePolicy from '@hooks/usePolicy'; import useThemeStyles from '@hooks/useThemeStyles'; -import useWindowDimensions from '@hooks/useWindowDimensions'; import {fetchUnreportedExpenses} from '@libs/actions/UnreportedExpenses'; import {convertToDisplayString} from '@libs/CurrencyUtils'; import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID'; import interceptAnonymousUser from '@libs/interceptAnonymousUser'; -import isInLandscapeMode from '@libs/isInLandscapeMode'; import type {AddUnreportedExpensesParamList} from '@libs/Navigation/types'; import {canSubmitPerDiemExpenseFromWorkspace, getPerDiemCustomUnit} from '@libs/PolicyUtils'; import {getTransactionDetails, isIOUReport} from '@libs/ReportUtils'; @@ -65,8 +64,7 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) { const [userBillingGracePeriodEnds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); const shouldShowUnreportedTransactionsSkeletons = isLoadingUnreportedTransactions && hasMoreUnreportedTransactionsResults && !isOffline; const [draftTransactionIDs] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_DRAFT, {selector: validTransactionDraftIDsSelector}); - const {windowHeight, windowWidth} = useWindowDimensions(); - + const isInLandscapeMode = useIsInLandscapeMode(); const initialSkeletonReasonAttributes: SkeletonSpanReasonAttributes = { context: 'AddUnreportedExpense.InitialSkeleton', isLoadingUnreportedTransactions, @@ -290,7 +288,7 @@ function AddUnreportedExpense({route}: AddUnreportedExpensePageType) { />