Add missing key prop and fix improper spacing in voter's list #210
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Number
fixes #209
Describe the changes you've made
Added
key
prop that points to the user's id which is unique to each user, hence resolving the unique key prop error.Regarding the improper spacing, I've created a new class
vote-item
that offsets themargin-left
to 0 that otherwise would be3em
set by the.author-information
class. So, only wherever this class is used the margin will be offset, hence no other parts of UI will be broken. This class is applied to the div container of the voter items in the voter's list (div containing the avatar and the username). This is used in 2 places.Vote
component).Above are the two places where the voter's list modal can be rendered.
I've also reduced the
padding-right
from6em
to3em
. These changes have fixed the appearance and thekey
prop warning. The results were further tested on both desktop mode and throttled to smartphone resolution mode. At both the stances, the appearance seemed to be alright.Describe if there is any unusual behavior (Any Warning) of your code(Write
NA
if there isn't)NA
Additional context (OPTIONAL)
Test plan (OPTIONAL)
A good test plan should give instructions that someone else can easily follow.
Checklist
Provide a Deployed link of route/page that needs to review
Preview: Deploy preview link here with the appropriate route