feat: maskpage&newchatpage adapt new ui framework done

This commit is contained in:
butterfly
2024-04-19 11:55:51 +08:00
parent b3559f99a2
commit 3d0a98d5d2
40 changed files with 2273 additions and 774 deletions

View File

@@ -1,16 +1,9 @@
import { useWindowSize } from "@/app/hooks/useWindowSize";
import { useRef } from "react";
export const MOBILE_MAX_WIDTH = 768;
export default function useMobileScreen() {
const widthRef = useRef<number>(0);
const { width } = useWindowSize();
useWindowSize((size) => {
widthRef.current = size.width;
});
const isMobile = widthRef.current <= MOBILE_MAX_WIDTH;
return isMobile;
return width <= MOBILE_MAX_WIDTH;
}