add useBreakpoint hook

This commit is contained in:
2025-10-05 17:48:32 +03:00
parent 740cf0dae0
commit b6df394166

View File

@@ -0,0 +1,25 @@
import { Grid } from "antd";
const { useBreakpoint } = Grid;
export default function useBreakPoint() {
const { xs, sm, md } = useBreakpoint();
if (xs)
return {
isDesktop: false,
isMobile: true,
isTablet: false,
};
if (md || sm)
return {
isDesktop: false,
isMobile: false,
isTablet: true,
};
return {
isDesktop: true,
isMobile: false,
isTablet: false,
};
}