Remove isTouch from use-screensize.js -- it's not an effect

It will be confusing for the next person to look at the effects folder for `isTouch`.

Use `platform.isTouch()` instead.
This commit is contained in:
infinite-persistence 2022-04-14 20:16:34 +08:00 committed by Thomas Zarebczan
parent 49db1fe83b
commit 934f627c19
2 changed files with 3 additions and 6 deletions

View file

@ -13,12 +13,13 @@ import NotificationBubble from 'component/notificationBubble';
import DebouncedInput from 'component/common/debounced-input';
import I18nMessage from 'component/i18nMessage';
import ChannelThumbnail from 'component/channelThumbnail';
import { useIsMobile, useIsLargeScreen, isTouch } from 'effects/use-screensize';
import { useIsMobile, useIsLargeScreen } from 'effects/use-screensize';
import { GetLinksData } from 'util/buildHomepage';
import { platform } from 'util/platform';
import { DOMAIN, ENABLE_UI_NOTIFICATIONS, ENABLE_NO_SOURCE_CLAIMS } from 'config';
import PremiumBadge from 'component/common/premium-badge';
const touch = isTouch();
const touch = platform.isTouch();
type SideNavLink = {
title: string,

View file

@ -91,7 +91,3 @@ export function useIsMediumScreen() {
export function useIsLargeScreen() {
return useHasWindowWidthChangedEnough((windowSize) => windowSize > 1600);
}
export function isTouch() {
return 'ontouchstart' in window || 'onmsgesturechange' in window;
}