Web: Components: Added isTouchDevice into utils

This commit is contained in:
TatianaLopaeva 2020-11-24 15:11:41 +03:00
parent 0dd804bd0b
commit 7ad92e3e40
2 changed files with 7 additions and 7 deletions

View File

@ -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 = () => {

View File

@ -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)
);