mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-09-21 11:29:20 +08:00
feat: maskpage&newchatpage adapt new ui framework done
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user