-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed PropType warning and show all vote stats in modal #1084
Fixed PropType warning and show all vote stats in modal #1084
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
we don't need to refactor UserCard to just fix that warning. We can set PropTypes to anything that makes sense from component's perspective.
To get rid of that warning we can just change PropTypes.bool
(which was a mistake I guess) to PropTypes.element
.
We shouldn't add any logic to UserCard. It is used in other places (followers/following list, and here vote value is not relevant). It should be as generic as possible.
I understand, thanks for letting me know. I will make the changes you asked. |
Followers/following list raises an error it seems if there is just |
Now I do not get any warnings, all logic is back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've meant to replace only bool
with element
, not everything.
Fixes #1080 .
Changes:
moved
alt
prop's elements from/components/Reactions/ReactionsList.js
to/components/UserCard.js
because of a PropType warning wherealt
prop was sent asobject
but astring
type was expected (screenshot below)removed the restriction to only show vote info for votes with the value greater than
0.1
. This way users can see all the votes information, including the downvotes information (as reported in the 1080)Screenshot of local (
dev-server
) PropType warning that comes once you click to show the votes modal: