Skip to content

Commit

Permalink
Merge pull request #34552 from Expensify/revert-33426-add-the-isInRHP…
Browse files Browse the repository at this point in the history
…-prop-to-the-ModalStackNavigator

[CP Staging] Revert "Add layout=narrow initial param to the ModalStackNavigator"

(cherry picked from commit 925dc3d)
  • Loading branch information
mountiny authored and OSBotify committed Jan 16, 2024
1 parent f6ea5f7 commit 4a7d4f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/hooks/useResponsiveLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useRoute} from '@react-navigation/native';
import useWindowDimensions from './useWindowDimensions';

type RouteParams = ParamListBase & {
params: {layout?: string};
params: {isInRHP?: boolean};
};
type ResponsiveLayoutResult = {
shouldUseNarrowLayout: boolean;
Expand All @@ -16,11 +16,10 @@ export default function useResponsiveLayout(): ResponsiveLayoutResult {
try {
// eslint-disable-next-line react-hooks/rules-of-hooks
const {params} = useRoute<RouteProp<RouteParams, 'params'>>();
const isNarrowLayout = params?.layout === 'narrow' ?? false;
const shouldUseNarrowLayout = isSmallScreenWidth || isNarrowLayout;

return {shouldUseNarrowLayout};
return {shouldUseNarrowLayout: isSmallScreenWidth || (params?.isInRHP ?? false)};
} catch (error) {
return {shouldUseNarrowLayout: isSmallScreenWidth};
return {
shouldUseNarrowLayout: isSmallScreenWidth,
};
}
}
1 change: 0 additions & 1 deletion src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function createModalStackNavigator<TStackParams extends ParamListBase>(screens:
key={name}
name={name}
getComponent={(screens as Required<Screens>)[name as Screen]}
initialParams={{layout: 'narrow'} as TStackParams[string]}
/>
))}
</ModalStackNavigator.Navigator>
Expand Down

0 comments on commit 4a7d4f9

Please sign in to comment.