diff --git a/packages/pl-fe/src/hooks/use-is-mobile.ts b/packages/pl-fe/src/hooks/use-is-mobile.ts index 2436954b8..3ff841371 100644 --- a/packages/pl-fe/src/hooks/use-is-mobile.ts +++ b/packages/pl-fe/src/hooks/use-is-mobile.ts @@ -1,6 +1,8 @@ +import { LAYOUT_BREAKPOINT } from 'pl-fe/is-mobile'; + import { useScreenWidth } from './use-screen-width'; export function useIsMobile() { const screenWidth = useScreenWidth(); - return screenWidth <= 581; + return screenWidth <= LAYOUT_BREAKPOINT; } diff --git a/packages/pl-fe/src/is-mobile.ts b/packages/pl-fe/src/is-mobile.ts index e72513407..e1376e96b 100644 --- a/packages/pl-fe/src/is-mobile.ts +++ b/packages/pl-fe/src/is-mobile.ts @@ -1,5 +1,5 @@ /** Breakpoint at which the application is considered "mobile". */ -const LAYOUT_BREAKPOINT = 630; +const LAYOUT_BREAKPOINT = 581; /** Check if the width is small enough to be considered "mobile". */ const isMobile = (width: number) => width <= LAYOUT_BREAKPOINT; @@ -12,4 +12,4 @@ const userTouching = window.matchMedia('(pointer: coarse)'); /** Whether the device is iOS (best guess). */ const isIOS = (): boolean => iOS; -export { isMobile, userTouching, isIOS }; +export { LAYOUT_BREAKPOINT, isMobile, userTouching, isIOS };