refactor(hooks): move useScreenSize hook to the correct directory and update import paths

This commit is contained in:
Ralex
2025-10-26 10:56:48 +01:00
parent 74707749aa
commit ba29466c69
3 changed files with 2 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
import { useEffect, useState } from "react"
const useScreenSize = () => {
const [screenSize, setScreenSize] = useState({
width: window.innerWidth,
height: window.innerHeight,
})
useEffect(() => {
const handleResize = () => {
setScreenSize({
width: window.innerWidth,
height: window.innerHeight,
})
}
window.addEventListener("resize", handleResize)
return () => {
window.removeEventListener("resize", handleResize)
}
}, [])
return screenSize
}
export default useScreenSize