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

[SUPPORT] : Rework Market with ReactQuery in LLD #6340

Merged
merged 47 commits into from
Apr 5, 2024

Conversation

mcayuelas-ledger
Copy link
Contributor

@mcayuelas-ledger mcayuelas-ledger commented Feb 29, 2024

📝 Description

Rework of Market pages in LLD with removal of MarketDataProvider :

  • Introducing new Hooks in live-common and LLD
  • Usage of TanstackQuery (ReactQuery)
  • Adding new part in Store dedicated to Market pages
  • Remove old stuff from Settings store to new Market store
  • Reworking some components to make them more readable
  • Adding TanstackQueryDevTool in Developer Tab in Settings
  • Applying the new architecture

With Rework :

  • Coin Detail Screen

    • Data with range ✅
    • range graph ✅
    • CounterValue change ✅
    • refresh every 1min ✅
    • CounterValue Change ✅
  • Market List

    • Data with range ✅
    • Range ✅
    • Refresh every 1min ✅
    • Sort by MarketCap ASC/DESC ✅
    • CounterValue change ✅
    • Starred Account ✅
    • Live Compatible ✅
  • MarketCrumb ✅

3 new Hooks :

  • useMarket => MarketList related actions and data
  • useMarketCoin => MarketCoin related actions and data
  • useMarketActions => Actions on currency (Buy/swap/Stake) used by both pages

New Architecture :

market
┣ MarketCoin
┃ ┣ components
┃ ┃ ┣ MarketCoinChart.tsx
┃ ┃ ┗ MarketInfo.tsx
┃ ┗ index.tsx
┣ MarketList
┃ ┣ components
┃ ┃ ┣ MarketItemChart.tsx
┃ ┃ ┣ MarketRowItem.tsx
┃ ┃ ┗ NoCryptoPlaceholder.tsx
┃ ┗ index.tsx
┣ assets
┃ ┗ ChartPlaceholder.tsx
┣ components
┃ ┣ CountervalueSelect.tsx
┃ ┣ DropDown.tsx
┃ ┣ SideDrawerFilter.tsx
┃ ┣ SortTableCell.tsx
┃ ┗ Table.tsx
┣ hooks
┃ ┣ useMarket.ts
┃ ┣ useMarketActions.ts
┃ ┗ useMarketCoin.ts
┗ index.tsx

Context & Explanations :
https://ledgerhq.atlassian.net/wiki/spaces/WXP/pages/4559208461/Market+Rework

This PR should fix also some bugs related to Market on both LLM and LLD
(Initiatives)

⚠️

Demo on LLD (Quick Demo)

Screen.Recording.2024-03-06.at.16.56.23.mov
Screen.Recording.2024-03-07.at.11.33.08.mov

FF & refreshRate example

Screen.Recording.2024-03-12.at.16.11.04.mov

Search & starred coins

Screen.Recording.2024-03-12.at.15.18.47.mov

❓ Context

✅ Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Remove MarketDatProvider
    • Use TanStackQuery to fetch/refetch data

QA Done ✅

https://ledgerhq.atlassian.net/browse/B2CQA-2227


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Feb 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Apr 5, 2024 9:52am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Apr 5, 2024 9:52am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 5, 2024 9:52am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 5, 2024 9:52am
web-tools ⬜️ Ignored (Inspect) Visit Preview Apr 5, 2024 9:52am

@mcayuelas-ledger
Copy link
Contributor Author

mcayuelas-ledger commented Mar 7, 2024

@mcayuelas-ledger

Generating screenshots: workflow ended

Jobs status:
❌ - generate-screenshots-linux

@mcayuelas-ledger mcayuelas-ledger force-pushed the support/react-query-market branch 2 times, most recently from bf85007 to 5a5d163 Compare March 12, 2024 09:59
@live-github-bot live-github-bot bot added the screenshots Screenshots have been updated label Mar 12, 2024
@live-github-bot live-github-bot bot added the ledgerjs Has changes in the ledgerjs open source libs label Mar 12, 2024
@mcayuelas-ledger mcayuelas-ledger changed the title [SUPPORT] : Rework Market with ReactQuery. (WIP ⚠️) [SUPPORT] : Rework Market with ReactQuery in LLD Mar 12, 2024
@mcayuelas-ledger mcayuelas-ledger marked this pull request as ready for review March 12, 2024 15:18
@mcayuelas-ledger mcayuelas-ledger requested review from a team as code owners March 12, 2024 15:18
@mcayuelas-ledger
Copy link
Contributor Author

mcayuelas-ledger commented Mar 13, 2024

@mcayuelas-ledger

Generating screenshots: workflow ended

Jobs status:
✅ - generate-screenshots-linux

Copy link

socket-security bot commented Mar 13, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

Great improvement 🚀

@mcayuelas-ledger mcayuelas-ledger merged commit 433bfec into develop Apr 5, 2024
54 of 55 checks passed
@mcayuelas-ledger mcayuelas-ledger deleted the support/react-query-market branch April 5, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common desktop Has changes in LLD ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM screenshots Screenshots have been updated translations Translation files have been touched
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants