Made App Responsive and Dynamic#26
Conversation
DisclaimerActually, these are breaking changes as the chessboard.tsx is completely revamped. I did make it compatible to some of the last PRs made by @Bhoomish-Patel and @dipamsen, including the I would request you (mentor) to decide which PR shall follow the rest, as either this one will break if there's is merged first, or there's will break if this gets merged. The breaking can be resolved easily though as my code is well aligned with the prior code (it uses the same logic as before but aims to improve readability, removes prop drilling of current player and removes playerName to chessWrapper > playerPanels), it also introduces a wrapper and a context, although css changes will be the ones which will take longer to resolve. |
|
It looks great! One suggestion I have is to separately style the player name of the lost player(s) (maybe more dark background or something) to indicate they are no longer a part of the game. |
|
Yea, you (@dipamsen) are right, the grey color is a little misleading as it shows both idle and lost. I have implemented what you suggested in recent commits. Now the playerState is clearly defined 'active' | 'inactive' | 'lost'. If lost, the player nameplate turns dark grey and the text shows 'Red Player Lost' for further clarity.
|
|
Hey, @prrockzed, sorry for mentioning you, but could you please review this PR by 25th if possible. |
|
Hi, @ThePhoenix08! |


🚀 Pull Request Overview
Closes Issue #2
Description
This PR is an extension of the #12. It includes the requested modifications and corrections asked. Following is the summary of the PR.
From #12
Now the modifications and corrections done in this PR
Summary:
🐛 Bug Fix:
Issue Fixed: Issue not created
Description of Fix: At initial render, the modal although not visible, is mounted to DOM. It tries to fetch the four pawn promotion options images but due to no trigger the pawn promotion function returns undefined as the team. This results in "undefinedR.png" etc being fetched. To resolve this issue, i added type guards on pawn promotion functions parameters and added a fallback to team RED just in case, for example initialization where although the modal is hidden, it has mounted.
Steps to Verify:
Steps to reproduce the bug (as described in the issue).
Actions to confirm the fix works as expected.
Note - (This is a temporary solution in my opinion but uses minimum changes, a more precise will be to conditionally render the complete modal using ReactJS instead of just classList toggling to prevent such problems.)
Additional Context
Screenshots of Mobile View and Desktop View of the new UI
to test please check out the dev deployment of this PR - https://thephoenix08.github.io/chessed
Open-Source Programs
Yes, I am making this PR as part of KWoC student contributor. I would request the mentor to please review this Pull Request.
✅ Checklist: