mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-03 03:11:40 +00:00
Add files
This commit is contained in:
commit
e87c814068
266 changed files with 63938 additions and 0 deletions
21
src/renderer/hooks/use-container-query.ts
Normal file
21
src/renderer/hooks/use-container-query.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { useElementSize } from '@mantine/hooks';
|
||||
|
||||
interface UseContainerQueryProps {
|
||||
lg?: number;
|
||||
md?: number;
|
||||
sm?: number;
|
||||
xl?: number;
|
||||
}
|
||||
|
||||
export const useContainerQuery = (props?: UseContainerQueryProps) => {
|
||||
const { lg, md, sm, xl } = props || {};
|
||||
const { ref, width, height } = useElementSize();
|
||||
|
||||
const isXs = width >= 0;
|
||||
const isSm = width >= (sm || 600);
|
||||
const isMd = width >= (md || 900);
|
||||
const isLg = width >= (lg || 1200);
|
||||
const isXl = width >= (xl || 1500);
|
||||
|
||||
return { height, isLg, isMd, isSm, isXl, isXs, ref, width };
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue