mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-18 03:01:09 +01:00
10 lines
421 B
TypeScript
10 lines
421 B
TypeScript
import { MantineSize, useMantineTheme } from '@mantine/core';
|
|
import { useMediaQuery } from '@mantine/hooks';
|
|
import { MIN_WIDTH_MOBILE } from '../constants/constants';
|
|
|
|
export const useScreenLargerThan = (size: MantineSize | number) => {
|
|
const { breakpoints } = useMantineTheme();
|
|
const pixelCount = typeof size === 'string' ? breakpoints[size] : size;
|
|
return useMediaQuery(`(min-width: ${MIN_WIDTH_MOBILE})`);
|
|
};
|