Skip to content
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

Merged
merged 10 commits into from
Jun 8, 2023
Merged

Dashboard wallet worth chart #141

merged 10 commits into from
Jun 8, 2023

Conversation

nop33
Copy link
Member

@nop33 nop33 commented May 25, 2023

Closes #70

image

@nop33 nop33 marked this pull request as draft May 25, 2023 16:47
@nop33
Copy link
Member Author

nop33 commented May 25, 2023

What I don't like though is that our type checker finds many type errors in the package... Maybe I should look for alternatives.

@nop33 nop33 changed the title WIP: Start using react-native-gifted-charts Dashboard wallet worth chart May 30, 2023
@nop33 nop33 requested a review from mvaivre May 30, 2023 10:18
@nop33
Copy link
Member Author

nop33 commented May 30, 2023

I replaced the react-native-gifted-charts lib with victory-native. It's much better maintained and has a much simpler API.

Ready for review!

@nop33 nop33 marked this pull request as ready for review May 30, 2023 10:20
Copy link
Member

@mvaivre mvaivre left a 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)
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about dis? :) 294c42d

Copy link
Member

@mvaivre mvaivre Jun 8, 2023

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!

Copy link
Member Author

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
Copy link
Member

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.

@nop33 nop33 changed the base branch from swap to master June 8, 2023 14:08
@nop33 nop33 merged commit 917b269 into master Jun 8, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display price chart in Dashboard screen
2 participants