-
Notifications
You must be signed in to change notification settings - Fork 29
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
app-root, lib-user: Add ProfileHeader to UserStats, refactor related API requests #5898
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.
This is looking good! I'm able to run app-root locally and view my staging stats at: https://local.zooniverse.org:3000/users/goplayoutside3/stats while signed-in 👍 When I sign-out, the stats aren't shown.
if (isNaN(value)) { | ||
displayValue = 0 | ||
} |
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.
In what scenario could this be NaN
? I ask because the value
prop passed to TitledStat is a required number
, so without an inline code comment here I'm confused why these additional lines are needed.
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.
Yes, great question, the reason these lines I think are necessary surprised me. typeof NaN
is actually 'number'
(which made me lol, I had forgotten that JavaScript quirk). NaN
can result from invalid arithmetic operations (as well as other reasons), and I think while loading stats or if there are no hours then the result of the equation that converts the seconds can result in NaN
.
Package
Describe your changes
How to Review
Helpful explanations that will make your reviewer happy:
https://local.zooniverse.org:3000/users/[insert your staging user login here]/stats
https://local.zooniverse.org:8080/?users=[insert your staging user login here]/stats
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedNew Feature
Refactoring