Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 8d25515</samp> ### Summary 🏆🔄📱 <!-- 1. 🏆 - This emoji represents the leaderboard and rewards breakdown features, which show the user's rank and rewards for each round of the trading competition. It also conveys a sense of achievement and competition. 2. 🔄 - This emoji represents the multiple rounds of the leaderboard and rewards breakdown, which let the user switch between the current and previous rounds of the trading competition. It also conveys a sense of continuity and progress. 3. 📱 - This emoji represents the mobile view of the leaderboard and rewards breakdown, which was improved and aligned with the desktop view. It also conveys a sense of accessibility and responsiveness. --> This pull request adds features to the `TradingReward` view and its components to show multiple rounds of the trading competition leaderboard and rewards breakdown. It also refactors and improves the data fetching, rendering, and layout logic of the components. It updates the useUserTradeRank hook to return more user rank data and a loading indicator. It removes unused props and translations and adds new translations for the new features. > _`Leaderboard` of doom, show me the ranks of the best_ > _`RewardsBreakdown` of despair, reveal the prizes of the rest_ > _`MyRank` of hope, inspire me to rise and compete_ > _`useUserTradeRank` of power, load the data and make it complete_ ### Walkthrough * Add new features to the Leaderboard and the RewardsBreakdown components to allow the user to switch between the current and previous rounds of the leaderboard and the rewards breakdown and show the round information for each round ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L22),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L28-R27),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L37-R35),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L43-R43),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L60-R60),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-94382753793192a4edd427aba2521b380c88958dbcc9821b7f456a923c67847aL1-R2),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-94382753793192a4edd427aba2521b380c88958dbcc9821b7f456a923c67847aL11-R19),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-94382753793192a4edd427aba2521b380c88958dbcc9821b7f456a923c67847aL23-R96),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-94382753793192a4edd427aba2521b380c88958dbcc9821b7f456a923c67847aL47-R171),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L1-R12),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L12),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L28),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13R47),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13R57),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L63-R96),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L84-R136),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L98),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-905d0511435088804181a66cc5ab45ff12f7236f3e07a3d752c1c2cdfa3b4247L88-R90)) * Create a new component called MyRank, which displays the user's own rank separately from the top 50 users, and use it in the Leaderboard component ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-162db74c38bd881f81ea3cac99f47db4187271b391e0d9c51d9bfab08cd5ce43R1-R68),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-94382753793192a4edd427aba2521b380c88958dbcc9821b7f456a923c67847aL47-R171)) * Modify the useUserTradeRank hook to return more properties of the user's rank data and an isFetching property to indicate the loading state ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-7daaf106864f93b18f65961b19005f1a0facbc3c4dfdd7f766e697d3824e5aefL8-R15),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-7daaf106864f93b18f65961b19005f1a0facbc3c4dfdd7f766e697d3824e5aefR26-R28),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-7daaf106864f93b18f65961b19005f1a0facbc3c4dfdd7f766e697d3824e5aefL38-R47)) * Modify the Leaderboard and the RewardsBreakdown components to handle the loading state and the undefined data more gracefully ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L43-R43),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L60-R60),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-4bf926d7d5e072659dfcf6f3db3ea66aa5958caa1849f1b86096c094fcc95d16L23-R27),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-4bf926d7d5e072659dfcf6f3db3ea66aa5958caa1849f1b86096c094fcc95d16L40-R53),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-f220411cac4174fd35a3d24356555fc08bb11f1ab78349cdceabc7f55ee45d5aL33-R33),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-f220411cac4174fd35a3d24356555fc08bb11f1ab78349cdceabc7f55ee45d5aL41-R41),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-f220411cac4174fd35a3d24356555fc08bb11f1ab78349cdceabc7f55ee45d5aL48-R50),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-d0cf24bc78fd41475144556445d7673e34f1d792bcda3efd5e624bab6631ced1L46-R46),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-d0cf24bc78fd41475144556445d7673e34f1d792bcda3efd5e624bab6631ced1L54-R54),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-cf88c6203950e52a3f8ea80d48d574d1ce87b9695f6965cf3e812ebda2d5119fL36-R36),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-cf88c6203950e52a3f8ea80d48d574d1ce87b9695f6965cf3e812ebda2d5119fL44-R44)) * Modify the table headers and the layout of the Leaderboard component to simplify the table and match the design of the mobile view ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-4b8800b925873b06295e95f7b8ab1cdb221b8d7898355d43b84d79c9116fa730L27-R31),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-5fd07b53fd6d3e6d1762ae5cd1d0b3ac32bdef19353c7d95340934d8359cf130L28-R27),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-4bf926d7d5e072659dfcf6f3db3ea66aa5958caa1849f1b86096c094fcc95d16L40-R53)) * Modify the CurrentPeriod component of the YourTradingReward component to destructure the data and the isFetching properties from the useUserTradeRank hook ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-cbc3dee4b1e1855ef521248a8dd17f1361a02964cd534ad687427b1ee69bed28L45-R45)) * Remove some unused props and translations from the RewardsBreakdown and the Leaderboard components ([link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L12),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-84dcb226924a4df52e63f545677d1d57610612105558abb2c22e78aa35cc8a13L28),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-8899ffb1860eb76dfa9555198ba793b2cd223454ddb9d53864b20d5a1ac094a7L95),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-905d0511435088804181a66cc5ab45ff12f7236f3e07a3d752c1c2cdfa3b4247L88-R90),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-eb2ab983e2cefc22516cb7814c86346f4b2bd2b971980952868173095d48f459L2449-L2450),[link](https://github.com/pancakeswap/pancake-frontend/pull/7296/files?diff=unified&w=0#diff-eb2ab983e2cefc22516cb7814c86346f4b2bd2b971980952868173095d48f459L2583))
- Loading branch information
09e7ead
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.
Successfully deployed to the following URLs:
uikit – ./packages/uikit
uikit.pancake.run
uikit-git-develop.pancake.run
09e7ead
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.
Successfully deployed to the following URLs:
web – ./apps/web
pancakeswap.finance
www.pancakeswap.finance
pancake-prod.vercel.app
web.pancake.run
web-git-develop.pancake.run