revite/src/lib/isTouchscreenDevice.ts

9 lines
271 B
TypeScript
Raw Normal View History

import { isDesktop, isMobile, isTablet } from "react-device-detect";
2021-07-05 06:23:23 -04:00
export const isTouchscreenDevice =
(isDesktop || isTablet)
2021-07-05 06:25:20 -04:00
? false
: (typeof window !== "undefined"
? navigator.maxTouchPoints > 0
: false) || isMobile;