diff --git a/src/Chessboard/Piece.js b/src/Chessboard/Piece.js index da4b661..5950075 100644 --- a/src/Chessboard/Piece.js +++ b/src/Chessboard/Piece.js @@ -161,7 +161,7 @@ const pieceSource = { if (onDrop.length) { wasManuallyDropped(true); // execute user's logic - return onDrop(props.currentSquare, dropResults.target); + return onDrop(props.currentSquare, dropResults.target, piece); } // set new position @@ -174,8 +174,8 @@ function collect(connect, monitor) { return { connectDragSource: connect.dragSource(), connectDragPreview: connect.dragPreview(), - isDragging: monitor.isDragging(), - dropTarget: monitor.getDropResult() + isDragging: monitor.isDragging() + // dropTarget: monitor.getDropResult() }; } diff --git a/src/Chessboard/index.js b/src/Chessboard/index.js index 3f142c9..9b7f547 100644 --- a/src/Chessboard/index.js +++ b/src/Chessboard/index.js @@ -310,7 +310,6 @@ class Chessboard extends Component { /* Called on drop if there is no onDrop prop. This is what executes when a position does not change through the position prop, i.e., simple drag and drop operations on the pieces.*/ setPosition = (piece, sourceSquare, targetSquare = null) => { - console.log('sq', sourceSquare, 'ts', targetSquare); const { currentPosition } = this.state; const { getPosition, dropOffBoard } = this.props; if (sourceSquare === targetSquare) return; diff --git a/src/Demo.js b/src/Demo.js index 0d236a8..5da604a 100644 --- a/src/Demo.js +++ b/src/Demo.js @@ -3,19 +3,19 @@ import React, { Component } from 'react'; import Chessboard from './Chessboard'; // import HumanVsRandom from './integrations/HumanVsRandom'; // import RandomVsRandom from './integrations/RandomVsRandom'; -// import HumanVsHuman from './integrations/HumanVsHuman'; +import HumanVsHuman from './integrations/HumanVsHuman'; // import RandomFEN from './integrations/RandomFEN'; // import Stockfish from './integrations/Stockfish'; // import { roughSquare } from './integrations/customRough'; -import lebronJames from './img/kingJames.png'; -import elvis from './img/elvis.png'; +// import lebronJames from './img/kingJames.png'; +// import elvis from './img/elvis.png'; // import defaultPieces from './Chessboard/svg/chesspieces/standard'; class Demo extends Component { render() { return (