mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-11-20 18:41:14 +01:00
refactor(web): Remove unused components and hooks (#1263)
* Update add_normal_icon.yml Signed-off-by: Thomas Camlong <thomas@ajnart.fr> * Update add_normal_icon.yml Signed-off-by: Thomas Camlong <thomas@ajnart.fr> * Update add_normal_icon.yml Signed-off-by: Thomas Camlong <thomas@ajnart.fr> * change id * refactor(web): Remove unused components and hooks --------- Signed-off-by: Thomas Camlong <thomas@ajnart.fr> Co-authored-by: Thomas Camlong <thomas@ajnart.fr>
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export function useMediaQuery(query: string): boolean {
|
||||
const [matches, setMatches] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
const media = window.matchMedia(query)
|
||||
|
||||
// Initial check
|
||||
if (media.matches !== matches) {
|
||||
setMatches(media.matches)
|
||||
}
|
||||
|
||||
// Setup listener for changes
|
||||
const listener = () => setMatches(media.matches)
|
||||
media.addEventListener("change", listener)
|
||||
|
||||
// Cleanup
|
||||
return () => media.removeEventListener("change", listener)
|
||||
}, [query, matches])
|
||||
|
||||
return matches
|
||||
}
|
||||
Reference in New Issue
Block a user