UNPKG

@wirelineio/shogiboardjsx

Version:

Shogiboardjsx is a shogiboard for React. Inspired by Chessboardjsx

35 lines (31 loc) 843 B
import React from 'react'; // eslint-disable-line no-unused-vars import PropTypes from 'prop-types'; import { renderChessPiece } from './Piece'; PhantomPiece.propTypes = { width: PropTypes.number, phantomPieceValue: PropTypes.string, pieces: PropTypes.object, allowDrag: PropTypes.func }; function PhantomPiece(_ref) { var width = _ref.width, pieces = _ref.pieces, phantomPieceValue = _ref.phantomPieceValue, allowDrag = _ref.allowDrag; return renderChessPiece({ width: width, pieces: pieces, piece: phantomPieceValue, phantomPieceStyles: phantomPieceStyles(width), allowDrag: allowDrag }); } export default PhantomPiece; var phantomPieceStyles = function phantomPieceStyles(width) { return { position: 'absolute', width: width / 8, height: width / 8, zIndex: 1 }; };