mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-09-21 03:11:55 +08:00
feat: chat panel redesigned ui
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import { useLayoutEffect } from "react";
|
||||
import { useWindowSize } from "../utils";
|
||||
import { useWindowSize } from "@/app/hooks/useWindowSize";
|
||||
import { useRef } from "react";
|
||||
|
||||
export const MOBILE_MAX_WIDTH = 600;
|
||||
export const MOBILE_MAX_WIDTH = 768;
|
||||
|
||||
export default function useMobileScreen() {
|
||||
const { width } = useWindowSize();
|
||||
const widthRef = useRef<number>(0);
|
||||
|
||||
const isMobile = width <= MOBILE_MAX_WIDTH;
|
||||
useWindowSize((size) => {
|
||||
widthRef.current = size.width;
|
||||
});
|
||||
|
||||
const isMobile = widthRef.current <= MOBILE_MAX_WIDTH;
|
||||
|
||||
return isMobile;
|
||||
}
|
||||
|
Reference in New Issue
Block a user