Hide the hover magnifier while dragging a card to arrange.

This commit is contained in:
Greyson Parrelli
2026-07-23 08:37:16 -04:00
parent 169b21d6a8
commit 3821469c61
3 changed files with 16 additions and 5 deletions
+10 -3
View File
@@ -16,6 +16,7 @@ interface Props {
export function ArrangePhase({ view, you, send }: Props) {
const [order, setOrder] = useState<Card[]>(you.deck ?? [])
const dragIndex = useRef<number | null>(null)
const [dragging, setDragging] = useState(false)
const locked = you.ready
// Resync only if the deck's actual contents changed — every broadcast
@@ -100,7 +101,10 @@ export function ArrangePhase({ view, you, send }: Props) {
key={c.id}
className="arrange-card"
draggable
onDragStart={() => (dragIndex.current = i)}
onDragStart={() => {
dragIndex.current = i
setDragging(true)
}}
onDragOver={(e) => {
e.preventDefault()
if (dragIndex.current !== null && dragIndex.current !== i) {
@@ -108,9 +112,12 @@ export function ArrangePhase({ view, you, send }: Props) {
dragIndex.current = i
}
}}
onDragEnd={() => (dragIndex.current = null)}
onDragEnd={() => {
dragIndex.current = null
setDragging(false)
}}
>
<CardView card={c} bonus={bonuses.get(c.id) ?? 0} />
<CardView card={c} bonus={bonuses.get(c.id) ?? 0} noMagnify={dragging} />
<div className="arrange-arrows">
<button
className="btn btn-ghost btn-sm"