1- import { useIsFocused , useRoute } from '@react-navigation/native' ;
1+ import { useRoute } from '@react-navigation/native' ;
22import React , { useCallback , useEffect , useMemo , useRef } from 'react' ;
33import type { LayoutChangeEvent } from 'react-native' ;
44import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView' ;
@@ -16,13 +16,11 @@ import usePendingConciergeResponse from '@hooks/usePendingConciergeResponse';
1616import usePrevious from '@hooks/usePrevious' ;
1717import useReportIsArchived from '@hooks/useReportIsArchived' ;
1818import useReportTransactionsCollection from '@hooks/useReportTransactionsCollection' ;
19- import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
2019import useSidePanelState from '@hooks/useSidePanelState' ;
2120import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport' ;
2221import { getReportPreviewAction } from '@libs/actions/IOU' ;
2322import { updateLoadingInitialReportAction } from '@libs/actions/Report' ;
2423import DateUtils from '@libs/DateUtils' ;
25- import getIsReportFullyVisible from '@libs/getIsReportFullyVisible' ;
2624import { getAllNonDeletedTransactions } from '@libs/MoneyRequestReportUtils' ;
2725import type { PlatformStackRouteProp } from '@libs/Navigation/PlatformStackNavigation/types' ;
2826import type { ReportsSplitNavigatorParamList } from '@libs/Navigation/types' ;
@@ -143,10 +141,6 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) {
143141 const reportPreviewAction = useMemo ( ( ) => getReportPreviewAction ( report ?. chatReportID , report ?. reportID ) , [ report ?. chatReportID , report ?. reportID ] ) ;
144142 const didLayout = useRef ( false ) ;
145143
146- const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
147- const isFocused = useIsFocused ( ) ;
148- const prevShouldUseNarrowLayoutRef = useRef ( shouldUseNarrowLayout ) ;
149- const isReportFullyVisible = useMemo ( ( ) => getIsReportFullyVisible ( isFocused ) , [ isFocused ] ) ;
150144 const { transactions : reportTransactions } = useTransactionsAndViolationsForReport ( reportID ) ;
151145 const reportTransactionIDs = useMemo (
152146 ( ) => getAllNonDeletedTransactions ( reportTransactions , allReportActions ?? [ ] ) . map ( ( transaction ) => transaction . transactionID ) ,
@@ -275,12 +269,6 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) {
275269 const isReportDataIncomplete = isSingleExpenseReport && isMissingTransactionThreadReportID ;
276270 const isMissingReportActions = visibleReportActions . length === 0 ;
277271
278- useEffect ( ( ) => {
279- // update ref with current state
280- prevShouldUseNarrowLayoutRef . current = shouldUseNarrowLayout ;
281- // eslint-disable-next-line react-hooks/exhaustive-deps
282- } , [ shouldUseNarrowLayout , reportActions , isReportFullyVisible ] ) ;
283-
284272 const allReportActionIDs = useMemo ( ( ) => allReportActions ?. map ( ( action ) => action . reportActionID ) ?? [ ] , [ allReportActions ] ) ;
285273
286274 const { loadOlderChats, loadNewerChats} = useLoadReportActions ( {
0 commit comments