mirror of
https://github.com/cupcakearmy/old.nicco.io.git
synced 2025-02-22 02:09:24 +00:00
check if mouse if set
This commit is contained in:
parent
2ea30235ab
commit
db3ce2e53a
@ -1,5 +1,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
|
||||
|
||||
type Size = { width: number, height: number }
|
||||
export const useInnerWindowSize = (): Size => {
|
||||
const getCurrentSize = (): Size => ({
|
||||
@ -19,7 +21,7 @@ export const useInnerWindowSize = (): Size => {
|
||||
}
|
||||
|
||||
export const useIsMousePresent = () => {
|
||||
let [present, setPresent] = useState<boolean>(false)
|
||||
let [present, setPresent] = useState<boolean>(!('ontouchstart' in window) && ('onmousemove' in window))
|
||||
|
||||
useEffect(() => {
|
||||
const enter = () => setPresent(true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user