diff --git a/src/components/common/CharacterFloatCard.tsx b/src/components/common/CharacterFloatCard.tsx index 91983b775d..13cfb960ab 100644 --- a/src/components/common/CharacterFloatCard.tsx +++ b/src/components/common/CharacterFloatCard.tsx @@ -1,5 +1,6 @@ "use client" +import { AnimatePresence, m } from "framer-motion" import { useState } from "react" import { @@ -12,7 +13,6 @@ import { useHover, useInteractions, useRole, - useTransitionStyles, } from "@floating-ui/react" import { CharacterCard } from "~/components/common/CharacterCard" @@ -28,13 +28,14 @@ export const CharacterFloatCard = ({ }) => { const [open, setOpen] = useState(false) - const { x, y, refs, strategy, context } = useFloating({ + const { floatingStyles, refs, context } = useFloating({ placement: "bottom-start", open, onOpenChange: setOpen, middleware: [offset(5), flip(), shift({ padding: 8 })], whileElementsMounted: autoUpdate, strategy: "fixed", + transform: false, }) const { getReferenceProps, getFloatingProps } = useInteractions([ @@ -43,10 +44,6 @@ export const CharacterFloatCard = ({ useDismiss(context), ]) - const { isMounted, styles } = useTransitionStyles(context, { - duration: 100, - }) - const [buttonLoading, setButtonLoading] = useState(false) return ( @@ -58,29 +55,29 @@ export const CharacterFloatCard = ({ > {children} - {isMounted && ( - - - - - - )} + + {open && ( + + + + + + )} + ) }