gbtami / chessgroundx

Fork of https://github.com/lichess-org/chessground Supports boards up to 16x16
GNU General Public License v3.0
39 stars 16 forks source link

Height and Width #40

Closed rdeyo1129 closed 1 year ago

rdeyo1129 commented 1 year ago

Hello, I'm running into some issues and questions with board dimensions. I am using the component similar to as follows:

<Chessground
  (insert valid props here)
/>

For fen, I tried both a 8/8/8/8/8/8/8/8 w KQkq - 0 1 setup and a 2/2 w KQkq - 0 1 setup, is that picked up like that by the fen prop? This is how I'm using dimensions and is only displaying what seems to be the default 8x8 board. Any thoughts on this or restrictions I should be aware of that is causing this issue? Let me know if I can elaborate further. Thanks for your time.

image

gbtami commented 1 year ago

Possible your doubled(!) parenthesis causes the trouble.

rdeyo1129 commented 1 year ago

Thanks for getting back to me, but that throws a lint error, I believe that is correct syntax because the first pair defines that you're going to pass an expression to the prop and the second pair is that you're passing in the object that seems to be defined in this documentation.

gbtami commented 1 year ago

Expected type of dimensions is definitely not an expression, but an object.

rdeyo1129 commented 1 year ago

I was using that term semantically, you can pass any JS in between the outer braces.

gbtami commented 1 year ago

I don't know your code. This picture is not enough to guess what it is. Sry. Anyhow, if you want to report a bug, provide a minimal working code to let us reproduce it please.

rdeyo1129 commented 1 year ago

Ok I'll look into it a bit more and maybe get back to you. I think I am forgetting that I used something to set it up a little differently, I have it setup so that Chessground can be used as a React JSX component. That's where those double parentheses can usually be found if you want to pass an object like that. Thanks for the feedback.

rdeyo1129 commented 1 year ago

If anyone stumbles upon this who was wondering and also using one of the react-chessground setups, my issue was that I didn't declare the prop type. Then you might want to look your styling by changing your piece and squares size percentages and the svg numbers.