mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
refactor: editor responsive navigation
This commit is contained in:
committed by
Carlos Valente
parent
cff73a65a5
commit
b991627cb7
@@ -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]);
|
||||
}
|
||||
Reference in New Issue
Block a user