RealToken-Community / dashboard-v2

https://dashboard.realt.community/
5 stars 4 forks source link

Add option to switch fiat currencies #14

Closed anthony-robin closed 12 months ago

anthony-robin commented 1 year ago

Fixes #12

Currently, the dashboard only display prices in $ fiat currency. This PR adds a new option allowing to switch from $ to using accurate rate provided by Gnosis API.

Capture d’écran 2023-09-11 à 20 23 34

⚠️ This is a draft PR ⚠️

I made most of changes to handle multiple currencies by my React knowledges are not strong enough for me to make it reactive. For now a page refresh is still necessary to update the price. Feel free to commit to this MR, pushing appropriate changes, and refactor my code if it does not follow the React best practices or rules <3

Co-Authored-By @NandyBa

anthony-robin commented 1 year ago

Thank you for the review ! I will have a deeper look to it and will be very happy to increase my skills on React by your reviews and advices :)

NandyBa commented 1 year ago

Let me check

NandyBa commented 1 year ago

Update the following cards to take into account currency changed

NandyBa commented 1 year ago

last 4 commits have are the result of a peer coding with @anthony-robin.

The currency switch is now dynamic and use store

anthony-robin commented 1 year ago

Updated the PR to handle more components currency switch

anthony-robin commented 1 year ago

Pushed an update to the AssetTable component I missed earlier. Still need to address Nandy's note about querying too much Gnosis endpoint.

anthony-robin commented 1 year ago

Addressed last Nandy's suggestion by passing rate from the parent to each asset components to avoid too many API calls.

I still have some hydratation issues showing up on the table view, I'm not sure what the issue is...

NandyBa commented 12 months ago

My most recent commits have: