@@ -2,7 +2,7 @@ import {PortalHost} from '@gorhom/portal';
22import { useIsFocused } from '@react-navigation/native' ;
33import { accountIDSelector } from '@selectors/Session' ;
44import { deepEqual } from 'fast-equals' ;
5- import React , { memo , useCallback , useContext , useEffect , useMemo , useRef , useState } from 'react' ;
5+ import React , { memo , useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
66import type { FlatList , ViewStyle } from 'react-native' ;
77// We use Animated for all functionality related to wide RHP to make it easier
88// to interact with react-navigation components (e.g., CardContainer, interpolator), which also use Animated.
@@ -20,7 +20,6 @@ import MoneyRequestReceiptView from '@components/ReportActionItem/MoneyRequestRe
2020import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView' ;
2121import ScreenWrapper from '@components/ScreenWrapper' ;
2222import ScrollView from '@components/ScrollView' ;
23- import { WideRHPContext } from '@components/WideRHPContextProvider' ;
2423import useShowWideRHPVersion from '@components/WideRHPContextProvider/useShowWideRHPVersion' ;
2524import WideRHPOverlayWrapper from '@components/WideRHPOverlayWrapper' ;
2625import useAppFocusEvent from '@hooks/useAppFocusEvent' ;
@@ -174,9 +173,6 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
174173 const { isOffline} = useNetwork ( ) ;
175174 const { shouldUseNarrowLayout, isInNarrowPaneModal} = useResponsiveLayout ( ) ;
176175
177- const { wideRHPRouteKeys, superWideRHPRouteKeys} = useContext ( WideRHPContext ) ;
178- const isDisplayedInWidePaneModal = wideRHPRouteKeys . includes ( route . key ) || superWideRHPRouteKeys . includes ( route . key ) ;
179- const isWideRHPOpened = wideRHPRouteKeys . length > 0 || superWideRHPRouteKeys . length > 0 ;
180176 const currentReportIDValue = useCurrentReportID ( ) ;
181177
182178 const [ isComposerFullSize = false ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_IS_COMPOSER_FULL_SIZE } ${ reportIDFromRoute } ` , { canBeMissing : true } ) ;
@@ -388,8 +384,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
388384 closeSidePanel ( ) ;
389385 return ;
390386 }
391-
392- if ( backTo === SCREENS . RIGHT_MODAL . SEARCH_REPORT || isDisplayedInWidePaneModal || isWideRHPOpened ) {
387+ if ( backTo === SCREENS . RIGHT_MODAL . SEARCH_REPORT ) {
393388 Navigation . goBack ( ) ;
394389 return ;
395390 }
@@ -411,7 +406,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
411406 }
412407 Navigation . goBack ( ) ;
413408 } ,
414- [ isInSidePanel , backTo , isDisplayedInWidePaneModal , isWideRHPOpened , isInNarrowPaneModal , closeSidePanel ] ,
409+ [ isInSidePanel , backTo , isInNarrowPaneModal , closeSidePanel ] ,
415410 ) ;
416411
417412 let headerView = (
0 commit comments