feat: chat panel redesigned ui

This commit is contained in:
butterfly
2024-04-16 14:07:51 +08:00
parent 3fc9b91bf1
commit 51a1d9f92a
41 changed files with 1350 additions and 526 deletions

View File

@@ -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;
}