Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add user earning history graph and list on history button click (…
…#12746) ## **Description** This PR adds a pooled staking user rewards history button to the asset detail page for ETH. This button leads to a bar chart graph of the user rewards over a 2 year period. A user can switch to 7D, M or Y to get 7 days, monthly or yearly data in the graph and can select different bars to see the amount of that bar's time period in the chart header. Default view with no selected bars shows the total amount of rewards earned. 1. What is the reason for the change? To add a chart view for the user to look at their historical rewards in detail 2. What is the improvement/solution? A chart view has been added that will allow the user to look at their historical rewards in detail ## **Related issues** [Fixes:](https://consensyssoftware.atlassian.net/browse/STAKE-705) ## **Manual testing steps** - Go to the asset view for eth by clicking on eth or staked eth in the token list on the home page - Note the total rewards on the asset detail page, it should be the same as in the chart - Click the button for earnings history where staking details are to see the chart, it should load - If there is any delay, there should be placeholders for the loading state - If there is an error and there is no data for some reason, the loading state is currently the default - The chart should show the total rewards and when you click on a bar that bar should become highlighted and stay highlighted until clicked again or until another bar is clicked. When highlighted the graph should show that bars info and that info should match the history list - In the chart, we do not skip zero amount time periods - In the list we do skip tailing zero amount time period but not any that are in between time periods with amounts - Clicking each time period in the top of the chart should switch the data to that time period and unselect any selected bar - The chart should be fairly quick to load and use and there should be no lagging actions ## **Screenshots/Recordings** ### **Before** No chart or button n/a ### **After** https://github.com/user-attachments/assets/750e6dc3-7055-48a2-a579-d76242e10c3e ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Matthew Grainger <46547583+Matt561@users.noreply.github.com>
- Loading branch information