Hide the hover magnifier while dragging a card to arrange.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user