-
Notifications
You must be signed in to change notification settings - Fork 6
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
Dashboard wallet worth chart #141
Conversation
What I don't like though is that our type checker finds many type errors in the package... Maybe I should look for alternatives. |
I replaced the Ready for review! |
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.
Just a nit! 👍
const trimInitialZeroDataPoints = (data: DataPoint[]) => data.slice(data.findIndex((point) => point.worth !== 0)) | ||
|
||
let dataPoints = computeChartDataPoints() | ||
dataPoints = trimInitialZeroDataPoints(dataPoints) |
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.
Nit:
const dataPoints = trimInitialZeroDataPoints(computeChartDataPoints())
Also, computeChartDataPoints
is only used once and doesn't need to be a function?
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.
Both computeChartDataPoints
and trimInitialZeroDataPoints
are called only once. The reason I made them functions is to use the function name as a hint to the developer of what is going on there so that I don't have to add a comment. I think it improves code readability.
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, I agree that declaring trimInitialZeroDataPoints
makes it more readable. IMO chartDataPoints
could be a variable, but I'm 💯% fine if we keep a function for this.
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.
How about dis? :) 294c42d
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! Just be careful, you have a styled component hidden in between two utils functions!
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.
oopsi!
<Stop offset="100%" stopColor={theme.bg.back1} /> | ||
</LinearGradient> | ||
</Defs> | ||
<VictoryArea |
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.
👍 I like how lightweight the API is.
Closes #70