From cad6d811dd2fb7ee2279b6bcc83bfc3c4f1c175c Mon Sep 17 00:00:00 2001 From: Tomasz Misiukiewicz Date: Wed, 13 May 2026 14:05:30 +0200 Subject: [PATCH] perf: move Search list isOffline into TransactionGroupListItem --- .../Search/SearchList/ListItem/TransactionGroupListItem.tsx | 3 ++- src/components/Search/SearchList/index.tsx | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx b/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx index 8cf609e83dbc..fca5405912ca 100644 --- a/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx +++ b/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx @@ -17,6 +17,7 @@ import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle'; import {useCurrencyListActions} from '@hooks/useCurrencyList'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; +import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useStyleUtils from '@hooks/useStyleUtils'; @@ -75,7 +76,6 @@ function TransactionGroupListItem({ columns, groupBy, searchType, - isOffline, newTransactionID, lastPaymentMethod, personalPolicyID, @@ -96,6 +96,7 @@ function TransactionGroupListItem({ const currentUserDetails = useCurrentUserPersonalDetails(); const isScreenFocused = useIsFocused(); const {convertToDisplayString} = useCurrencyListActions(); + const {isOffline} = useNetwork(); const oneTransactionItem = groupItem.isOneTransactionReport ? groupItem.transactions.at(0) : undefined; const [parentReport] = originalUseOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(oneTransactionItem?.reportID)}`); diff --git a/src/components/Search/SearchList/index.tsx b/src/components/Search/SearchList/index.tsx index df4cff50cd2f..acb260c354ea 100644 --- a/src/components/Search/SearchList/index.tsx +++ b/src/components/Search/SearchList/index.tsx @@ -458,7 +458,6 @@ function SearchList({ ownerBillingGracePeriodEnd={ownerBillingGracePeriodEnd} personalDetails={personalDetails} userBillingFundID={userBillingFundID} - isOffline={isOffline} violations={violations} nonPersonalAndWorkspaceCards={nonPersonalAndWorkspaceCards} onFocus={onFocus} @@ -490,7 +489,6 @@ function SearchList({ policies, personalDetails, userBillingFundID, - isOffline, violations, lastPaymentMethod, personalPolicyID,