Skip to content

Commit

Permalink
add shouldUseNarrowLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
rayane-djouah committed Jan 25, 2024
1 parent dfcbaf7 commit 4915f12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hooks/useResponsiveLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import NAVIGATORS from '@src/NAVIGATORS';
import useWindowDimensions from './useWindowDimensions';

type ResponsiveLayoutResult = {
shouldUseNarrowLayout: boolean;
isSmallScreenWidth: boolean;
isInModal: boolean;
};
Expand All @@ -15,5 +16,6 @@ export default function useResponsiveLayout(): ResponsiveLayoutResult {
const lastRoute = state?.routes?.at(-1);
const lastRouteName = lastRoute?.name;
const isInModal = lastRouteName === NAVIGATORS.LEFT_MODAL_NAVIGATOR || lastRouteName === NAVIGATORS.RIGHT_MODAL_NAVIGATOR;
return {isSmallScreenWidth, isInModal};
const shouldUseNarrowLayout = isSmallScreenWidth || isInModal;
return {shouldUseNarrowLayout, isSmallScreenWidth, isInModal};
}

0 comments on commit 4915f12

Please sign in to comment.