Latest solutions
Latest comments
- @mehmetakifakkusSubmitted over 1 year ago@cjcrawfordPosted over 1 year ago
The guidelines were definitely unclear around the up/down votes. The idea to flag a comment as able to be voted or not is definitely the right idea. Once you think about it from the context of the unique user on the page (again, a rather unspecified clarification), you might begin to see a few possible solutions.
I personally opted to track the user's comment votes by commentId: undefined | oneOf [-1, 1] meaning for each comment, the user could only have not voted, down voted, or upvoted. The only criteria in which the user can place a successful vote would be when commentVotes[commentId] is falsy.
Knowing the capability of the user's ability to vote also gives the benefit of disabling/enabling the arrows from a visual indicator too.
The CSS and html and UX works great though on first pass on my phone. Nice work!
1