feat: replace drag overlay image preview with CardComponent and adjust its size and styling.
All checks were successful
Build and Deploy / build (push) Successful in 1m56s
All checks were successful
Build and Deploy / build (push) Successful in 1m56s
This commit is contained in:
@@ -1016,16 +1016,20 @@ export const GameView: React.FC<GameViewProps> = ({ gameState, currentPlayerId }
|
|||||||
</div>
|
</div>
|
||||||
<DragOverlay dropAnimation={{ duration: 0, easing: 'linear' }}>
|
<DragOverlay dropAnimation={{ duration: 0, easing: 'linear' }}>
|
||||||
{activeDragId ? (
|
{activeDragId ? (
|
||||||
<div className="w-32 h-48 pointer-events-none opacity-80 z-[1000]">
|
<div className="w-24 h-24 pointer-events-none opacity-90 z-[1000] drop-shadow-2xl">
|
||||||
<img
|
{(() => {
|
||||||
src={(() => {
|
|
||||||
const c = gameState.cards[activeDragId];
|
const c = gameState.cards[activeDragId];
|
||||||
return c?.image_uris?.normal ||
|
if (!c) return null;
|
||||||
(c?.definition?.set && c?.definition?.id ? `/cards/images/${c.definition.set}/full/${c.definition.id}.jpg` : c?.imageUrl);
|
return (
|
||||||
})()}
|
<CardComponent
|
||||||
alt="Drag Preview"
|
card={c}
|
||||||
className="w-full h-full object-cover rounded-xl shadow-2xl"
|
viewMode="cutout"
|
||||||
|
onDragStart={() => { }}
|
||||||
|
onClick={() => { }}
|
||||||
|
className="w-full h-full rounded-lg shadow-2xl ring-2 ring-white/50"
|
||||||
/>
|
/>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</DragOverlay>
|
</DragOverlay>
|
||||||
|
|||||||
Reference in New Issue
Block a user