Skip to content

Conversation

@emilioh93
Copy link
Contributor

@emilioh93 emilioh93 commented Apr 16, 2025

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.

image

Added a sorting dropdown to the leaderboard component, allowing users to sort drivers by various criteria such as position, best lap, last lap, and more. Updated the sorting logic in the sorting utility to accommodate new criteria and integrated a Zustand store for managing the selected sorting criteria.
@vercel
Copy link

vercel bot commented Apr 16, 2025

@emilioh93 is attempting to deploy a commit to the f1-dash Team on Vercel.

A member of the Team first needs to authorize it.

@emilioh93 emilioh93 marked this pull request as ready for review April 16, 2025 01:50
@emilioh93 emilioh93 requested a review from slowlydev as a code owner April 16, 2025 01:50
@vercel
Copy link

vercel bot commented Apr 17, 2025

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

@slowlydev
Copy link
Owner

@emilioh93 thanks! 2 things:

  1. 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)

  2. I don't think this design is optimal, it needs more thought and integration...

@emilioh93
Copy link
Contributor Author

@emilioh93 thanks! 2 things:

  1. 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)
  2. 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 😊.

@mathew2103
Copy link

What about clicking on the column headers sorts according to that column in ascending, click again and its descending.

@slowlydev
Copy link
Owner

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

emilioh93 and others added 2 commits April 22, 2025 10:00
- Added `react-icons` dependency for improved UI elements.
- Updated the LeaderBoard component to include sorting icons for better user experience.
- Enhanced sorting logic to support direction toggling and integrated it with the Zustand store.
- Refactored Select component for better styling and functionality.
@emilioh93
Copy link
Contributor Author

based on the last comments, I applied a few changes

@emilioh93
Copy link
Contributor Author

@slowlydev it's been a long time since this PR, maybe it's time to close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants