fix "useBreakpoint" hook
This commit is contained in:
@@ -3,12 +3,11 @@ import { Grid } from "antd";
|
|||||||
const { useBreakpoint } = Grid;
|
const { useBreakpoint } = Grid;
|
||||||
|
|
||||||
export default function useBreakPoint() {
|
export default function useBreakPoint() {
|
||||||
const { xs, sm, md } = useBreakpoint();
|
const { sm, md, lg, xl, xxl } = useBreakpoint();
|
||||||
|
if (lg || xl || xxl)
|
||||||
if (xs)
|
|
||||||
return {
|
return {
|
||||||
isDesktop: false,
|
isDesktop: true,
|
||||||
isMobile: true,
|
isMobile: false,
|
||||||
isTablet: false,
|
isTablet: false,
|
||||||
};
|
};
|
||||||
if (md || sm)
|
if (md || sm)
|
||||||
@@ -18,8 +17,8 @@ export default function useBreakPoint() {
|
|||||||
isTablet: true,
|
isTablet: true,
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
isDesktop: true,
|
isDesktop: false,
|
||||||
isMobile: false,
|
isMobile: true,
|
||||||
isTablet: false,
|
isTablet: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user