Web: Components: Added isTouchDevice into utils
This commit is contained in:
parent
0dd804bd0b
commit
7ad92e3e40
@ -4,7 +4,7 @@ import React from "react";
|
||||
|
||||
import loadImageURL from "./utils/load-image-url";
|
||||
import loadImageFile from "./utils/load-image-file";
|
||||
|
||||
import { isTouchDevice } from "../../../../utils/device";
|
||||
const makeCancelable = (promise) => {
|
||||
let hasCanceled_ = false;
|
||||
|
||||
@ -25,12 +25,6 @@ const makeCancelable = (promise) => {
|
||||
};
|
||||
};
|
||||
|
||||
const isTouchDevice = !!(
|
||||
typeof window !== "undefined" &&
|
||||
typeof navigator !== "undefined" &&
|
||||
("ontouchstart" in window || navigator.msMaxTouchPoints > 0)
|
||||
);
|
||||
|
||||
const isFileAPISupported = typeof File !== "undefined";
|
||||
|
||||
const isPassiveSupported = () => {
|
||||
|
@ -28,3 +28,9 @@ export const isTablet = () => {
|
||||
export const isDesktop = () => {
|
||||
return window.innerWidth >= size.desktop;
|
||||
};
|
||||
|
||||
export const isTouchDevice = !!(
|
||||
typeof window !== "undefined" &&
|
||||
typeof navigator !== "undefined" &&
|
||||
("ontouchstart" in window || navigator.msMaxTouchPoints > 0)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user