Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) {
<Stack.Screen
name={SCREENS.RIGHT_MODAL.SEARCH_REPORT}
getComponent={loadReportScreen}
options={{...modalStackScreenOptions, animation: Animations.NONE}}
options={(props) => {
const options = modalStackScreenOptions(props);
return {...options, animation: Animations.NONE};
Comment on lines +344 to +346

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here to explain why this has to be done?

}}
/>
<Stack.Screen
name={SCREENS.RIGHT_MODAL.RESTRICTED_ACTION}
Expand Down
11 changes: 3 additions & 8 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {PortalHost} from '@gorhom/portal';
import {useIsFocused} from '@react-navigation/native';
import {accountIDSelector} from '@selectors/Session';
import {deepEqual} from 'fast-equals';
import React, {memo, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
import React, {memo, useCallback, useEffect, useMemo, useRef, useState} from 'react';
import type {FlatList, ViewStyle} from 'react-native';
// We use Animated for all functionality related to wide RHP to make it easier
// to interact with react-navigation components (e.g., CardContainer, interpolator), which also use Animated.
Expand All @@ -20,7 +20,6 @@ import MoneyRequestReceiptView from '@components/ReportActionItem/MoneyRequestRe
import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import {WideRHPContext} from '@components/WideRHPContextProvider';
import useShowWideRHPVersion from '@components/WideRHPContextProvider/useShowWideRHPVersion';
import WideRHPOverlayWrapper from '@components/WideRHPOverlayWrapper';
import useAppFocusEvent from '@hooks/useAppFocusEvent';
Expand Down Expand Up @@ -174,9 +173,6 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
const {isOffline} = useNetwork();
const {shouldUseNarrowLayout, isInNarrowPaneModal} = useResponsiveLayout();

const {wideRHPRouteKeys, superWideRHPRouteKeys} = useContext(WideRHPContext);
const isDisplayedInWidePaneModal = wideRHPRouteKeys.includes(route.key) || superWideRHPRouteKeys.includes(route.key);
const isWideRHPOpened = wideRHPRouteKeys.length > 0 || superWideRHPRouteKeys.length > 0;
const currentReportIDValue = useCurrentReportID();

const [isComposerFullSize = false] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${reportIDFromRoute}`, {canBeMissing: true});
Expand Down Expand Up @@ -388,8 +384,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
closeSidePanel();
return;
}

if (backTo === SCREENS.RIGHT_MODAL.SEARCH_REPORT || isDisplayedInWidePaneModal || isWideRHPOpened) {
if (backTo === SCREENS.RIGHT_MODAL.SEARCH_REPORT) {
Navigation.goBack();
return;
}
Expand All @@ -411,7 +406,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
}
Navigation.goBack();
},
[isInSidePanel, backTo, isDisplayedInWidePaneModal, isWideRHPOpened, isInNarrowPaneModal, closeSidePanel],
[isInSidePanel, backTo, isInNarrowPaneModal, closeSidePanel],
);

let headerView = (
Expand Down