refactor: editor responsive navigation

This commit is contained in:
Carlos Valente
2025-06-22 12:43:11 +02:00
committed by Carlos Valente
parent cff73a65a5
commit b991627cb7
10 changed files with 131 additions and 66 deletions
@@ -0,0 +1,9 @@
import { useMemo } from 'react';
import { useOs, useViewportSize } from '@mantine/hooks';
export function useIsMobile(): boolean {
const { width } = useViewportSize();
const os = useOs();
return useMemo(() => (os === 'ios' || os === 'android') && width < 800, [width, os]);
}
@@ -0,0 +1,9 @@
import { useMemo } from 'react';
import { useOs, useViewportSize } from '@mantine/hooks';
export function useIsSmallDevice(): boolean {
const { width } = useViewportSize();
const os = useOs();
return useMemo(() => (os === 'ios' || os === 'android') && width < 1300, [width, os]);
}
@@ -0,0 +1,8 @@
import { useMemo } from 'react';
import { useViewportSize } from '@mantine/hooks';
export function useIsSmallScreen(): boolean {
const { width } = useViewportSize();
return useMemo(() => width < 1300, [width]);
}