feat: basic initial UI layout for mobile and desktop

This commit is contained in:
Jose Selesan
2026-09-07 09:33:07 -03:00
parent 0aa5d70101
commit b41fffa40a
46 changed files with 2102 additions and 125 deletions

View File

@@ -0,0 +1,19 @@
import { useEffect, useState } from 'react'
const MOBILE_QUERY = '(max-width: 1023px)'
export function useIsMobile() {
const [isMobile, setIsMobile] = useState(
() => typeof window !== 'undefined' && window.matchMedia(MOBILE_QUERY).matches,
)
useEffect(() => {
const mql = window.matchMedia(MOBILE_QUERY)
const handleChange = (event: MediaQueryListEvent) => setIsMobile(event.matches)
setIsMobile(mql.matches)
mql.addEventListener('change', handleChange)
return () => mql.removeEventListener('change', handleChange)
}, [])
return isMobile
}