revite/src/lib/isTouchscreenDevice.ts

9 lines
270 B
TypeScript
Raw Normal View History

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