mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 15:05:48 +01:00
✨ Add gridstack dashboard layout
This commit is contained in:
8
src/tools/hooks/useScreenSmallerThan.ts
Normal file
8
src/tools/hooks/useScreenSmallerThan.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { MantineSize, useMantineTheme } from '@mantine/core';
|
||||
import { useMediaQuery } from '@mantine/hooks';
|
||||
|
||||
export const useScreenSmallerThan = (size: MantineSize | number) => {
|
||||
const { breakpoints } = useMantineTheme();
|
||||
const pixelCount = typeof size === 'string' ? breakpoints[size] : size;
|
||||
return useMediaQuery(`(max-width: ${pixelCount}px)`);
|
||||
};
|
||||
Reference in New Issue
Block a user