- I updated the player data to give it a bit more teams variety
- Instead of implementing a user login, I built a nav bar to toggle between regular vs admin user
- When user is admin, the "Toggle End voting" option will be available in the nav bar dropdown. The admin user can use this option to end or resume voting
- While voting, clicking on a player's icon will vote for the player, and clicking on the same player again will un-vote the player. The number of like and hence voting percentage will update accordingly
- While voting is in progress, selecting a different region will clear the user's votes in the previous region, since the user is only allowed to vote in one region
- After voting has ended, selecting a different region will not clear the user's votes, since the results are final
- When switching between admin/regular users, the voted players will be cleared since the user is different
Clone this repo with
git clone https://github.com/bcfchen/player-voting.git
cd into the player-voting/client folder and install npm packages by:
npm install
Check that you're in the player-voting/client folder and run the project by:
npm start
The page should automatically open up in your browser at localhost:3000
- React/Redux