Skip to content

Commit

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

type ResponsiveLayoutResult = {
shouldUseNarrowLayout: boolean;
isSmallScreenWidth: boolean;
isInModal: boolean;
};
/**
* Hook to determine if we are on mobile devices or in the Modal Navigator
Expand All @@ -14,6 +15,5 @@ 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;
const shouldUseNarrowLayout = isSmallScreenWidth || isInModal;
return {shouldUseNarrowLayout};
return {isSmallScreenWidth, isInModal};
}

0 comments on commit dfcbaf7

Please sign in to comment.