manifold/web/hooks/use-is-mobile.ts

8 lines
190 B
TypeScript
Raw Permalink Normal View History

2022-09-16 15:28:39 +00:00
import { useWindowSize } from 'web/hooks/use-window-size'
// matches talwind sm breakpoint
2022-09-16 15:28:39 +00:00
export function useIsMobile() {
const { width } = useWindowSize()
return (width ?? 0) < 640
2022-09-16 15:30:09 +00:00
}