adjust artist album grid span

This commit is contained in:
jeffvli
2025-12-27 16:22:02 -08:00
parent 331cddcabb
commit 710fc16f62
2 changed files with 51 additions and 10 deletions
+36 -8
View File
@@ -3,6 +3,8 @@ import { useElementSize } from '/@/shared/hooks/use-element-size';
interface UseContainerQueryProps {
'2xl'?: number;
'3xl'?: number;
'4xl'?: number;
'5xl'?: number;
lg?: number;
md?: number;
sm?: number;
@@ -11,18 +13,44 @@ interface UseContainerQueryProps {
}
export const useContainerQuery = (props?: UseContainerQueryProps) => {
const { '2xl': xxl, '3xl': xxxl, lg, md, sm, xl, xs } = props || {};
const {
'2xl': xxl,
'3xl': xxxl,
'4xl': xxxxl,
'5xl': xxxxxl,
lg,
md,
sm,
xl,
xs,
} = props || {};
const { height, ref, width } = useElementSize();
const isXs = width >= (xs || 360);
const isSm = width >= (sm || 600);
const isMd = width >= (md || 768);
const isLg = width >= (lg || 960);
const isXl = width >= (xl || 1200);
const is2xl = width >= (xxl || 1440);
const is3xl = width >= (xxxl || 1920);
const isSm = width >= (sm || 480);
const isMd = width >= (md || 600);
const isLg = width >= (lg || 768);
const isXl = width >= (xl || 960);
const is2xl = width >= (xxl || 1152);
const is3xl = width >= (xxxl || 1280);
const is4xl = width >= (xxxxl || 1440);
const is5xl = width >= (xxxxxl || 1600);
const isCalculated = width !== 0;
return { height, is2xl, is3xl, isCalculated, isLg, isMd, isSm, isXl, isXs, ref, width };
return {
height,
is2xl,
is3xl,
is4xl,
is5xl,
isCalculated,
isLg,
isMd,
isSm,
isXl,
isXs,
ref,
width,
};
};