From 5c42e5f4a1243741038df5bd581fd5ea8b7709c9 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Sun, 23 Feb 2025 20:54:58 +0800 Subject: [PATCH] chore: remove unused file --- src/routes/chat/Layout/NewMessageTopTip.tsx | 49 --------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/routes/chat/Layout/NewMessageTopTip.tsx diff --git a/src/routes/chat/Layout/NewMessageTopTip.tsx b/src/routes/chat/Layout/NewMessageTopTip.tsx deleted file mode 100644 index af1e9d0a..00000000 --- a/src/routes/chat/Layout/NewMessageTopTip.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; -import clsx from "clsx"; - -import { triggerScrollHeight } from "./MessageFeed"; - -type Props = { - count: number; - queryKey: string; -}; -// linear-gradient(135deg,_#3C8CE7_0%,_#00EAFF_100%) -const NewMessageBottomTip = ({ count, queryKey }: Props) => { - const [visible, setVisible] = useState(false); - const { t } = useTranslation("chat"); - useEffect(() => { - const container = document.querySelector(queryKey) as HTMLElement; - if (container) { - const { scrollHeight, scrollTop, offsetHeight } = container; - const deltaNum = scrollHeight - scrollTop - offsetHeight; - const showTheTip = deltaNum > triggerScrollHeight && count > 0; - console.log("show the tip", showTheTip); - setVisible(showTheTip); - } - }, [queryKey, count]); - const handleMarkRead = () => { - const container = document.querySelector(queryKey) as HTMLElement; - if (container) { - // scroll to bottom - container.scrollTop = container.scrollHeight; - setVisible(false); - } - }; - return ( - - ); -}; - -export default NewMessageBottomTip;