feat: header and utenti page mobile friendly

This commit is contained in:
2024-10-12 03:32:28 +02:00
parent f287071674
commit 2cbef56377
6 changed files with 135 additions and 3 deletions
+12
View File
@@ -1,3 +1,5 @@
import { useEffect, useMemo, useState } from 'preact/hooks'
export const trottleDebounce = <T extends any[], R>(
fn: (...args: T) => R,
delay: number,
@@ -52,3 +54,13 @@ export function clsx(...args: ClassValue[]): string {
})
.join(' ')
}
export const isMobile = () => {
const [windowWidth, setWindowWidth] = useState(0)
useEffect(() => {
setWindowWidth(window.innerWidth)
}, [])
return windowWidth < 1024
}