fix: add tooltip for resize panel

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-09-21 20:44:42 +08:00
parent cd4473b306
commit cdec351035
5 changed files with 71 additions and 17 deletions
@@ -1,6 +1,6 @@
import { m } from "framer-motion"
import type { FC, PropsWithChildren } from "react"
import { memo, useCallback, useRef, useState } from "react"
import { memo, useCallback, useEffect, useRef, useState } from "react"
import { useTranslation } from "react-i18next"
import { Link } from "react-router-dom"
import { toast } from "sonner"
@@ -77,10 +77,16 @@ export const FeedColumnHeader = memo(() => {
const LayoutActionButton = () => {
const feedColumnShow = useFeedColumnShow()
const [animation] = useState({
const [animation, setAnimation] = useState({
width: !feedColumnShow ? "auto" : 0,
})
useEffect(() => {
setAnimation({
width: !feedColumnShow ? "auto" : 0,
})
}, [feedColumnShow])
const t = useI18n()
return (
<m.div initial={animation} animate={animation} className="overflow-hidden">