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