feat(leaderboard): Add sorting functionality to the leaderboard
Description
This pull request adds sorting functionality to the leaderboard component. Users can now sort the drivers by various criteria, including:
- Position
- Best Lap
- Last Lap
- Pit Status
- Position Change
- Sector 1, 2, and 3 times
- Tyre Age
Changes Made
- Created a new sorting store to manage sorting preferences.
- Implemented a sorting utility function to handle different sorting criteria.
- Updated the LeaderBoard component to include a sorting dropdown above the table.
- Improved the styling of the sorting selector for better visibility.
Please review the changes and let me know if any adjustments are needed.
@emilioh93 is attempting to deploy a commit to the f1-dash Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| f1-dash | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 25, 2025 11:48am |
@emilioh93 thanks! 2 things:
-
use the custom select component in the repo. (Its not fully done yet and has weird transparency, which I fixed here, so these changes would need to be ported)
-
I don't think this design is optimal, it needs more thought and integration...
@emilioh93 thanks! 2 things:
- use the custom select component in the repo. (Its not fully done yet and has weird transparency, which I fixed here, so these changes would need to be ported)
- I don't think this design is optimal, it needs more thought and integration...
Thanks for the feedback, very clear!
- Regarding the custom select, do you think we should wait for those changes to be fully integrated before moving forward with this PR, or would you prefer that I incorporate them from now on carrying the corrections you mentioned?
- And about the design, totally agree that it can be better thought out. do you think it would make sense to close this PR and pick up again when there is a clearer direction, or would you prefer we keep it open while we adjust?
I'm happy to make the changes needed, I just want to make sure the timing and direction is right 😊.
What about clicking on the column headers sorts according to that column in ascending, click again and its descending.
What about clicking on the column headers sorts according to that column in ascending, click again and its descending.
yeah that could go in the right direction. maybe we could also hide the dropdown behind a filter or sort icon. which o'clock shows the input or the options right away
based on the last comments, I applied a few changes
@slowlydev it's been a long time since this PR, maybe it's time to close it?