PromucFlow_constructor/app/client/src/utils/hooks/useDeviceDetect.ts
albinAppsmith 39e28f4e1b
feat: Homepage mobile UI (#10255)
* * Added hooks for detecting device
* fixed partial header issues

* * mobile UI completed

* config URL changed

* * bug fix

* * bug fix

* * mobile - on tap of app card launch app

* * conflict fix
* removed context menu from app card

* * homepage cy fix
2022-02-17 22:08:36 +05:30

25 lines
512 B
TypeScript

import { useMediaQuery } from "react-responsive";
import {
MOBILE_MAX_WIDTH,
TABLET_MIN_WIDTH,
TABLET_MAX_WIDTH,
DESKTOP_MIN_WIDTH,
} from "constants/AppConstants";
export function useIsMobileDevice() {
return useMediaQuery({ maxWidth: MOBILE_MAX_WIDTH });
}
export function useIsTabletDevice() {
return useMediaQuery({
minWidth: TABLET_MIN_WIDTH,
maxWidth: TABLET_MAX_WIDTH,
});
}
export function useIsDesktopDevice() {
return useMediaQuery({
minWidth: DESKTOP_MIN_WIDTH,
});
}