pl-fe: improve stuff sorry for not descriptive commit messages
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user