-
Notifications
You must be signed in to change notification settings - Fork 0
Refine leaderboard toggles with square styling and polished hover glow #6
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
Conversation
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.
Pull Request Overview
This PR refactors the leaderboard UI from button-based controls to a segmented toggle control component, with improved mobile responsiveness and layout adjustments. The changes modernize the leaderboard interface with a more polished, iOS-style segmented control for period and duration selection.
- Introduces a new
SegmentedTogglecomponent to replace existing button-based controls for period and duration selection - Refactors landing page leaderboard layout from flexbox to CSS Grid for better responsive behavior
- Improves mobile experience with conditional rendering and compact styling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| client/src/components/Leaderboard.jsx | Adds SegmentedToggle component and refactors leaderboard controls to use it in both landing and modal layouts |
| client/src/components/Leaderboard.css | Adds comprehensive styling for SegmentedToggle component with animations and responsive adjustments |
| client/src/pages/Landing.css | Converts leaderboard section from flexbox to CSS Grid layout with updated responsive breakpoints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| top: 0.2rem; | ||
| bottom: 0.2rem; | ||
| left: 0.2rem; | ||
| width: calc((100% - 0.4rem) / var(--segments)); |
Copilot
AI
Nov 4, 2025
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.
The magic number 0.4rem (padding * 2) is hardcoded in the calculation. Consider defining this as a CSS custom property like --toggle-padding: 0.2rem and using it here as calc((100% - calc(var(--toggle-padding) * 2)) / var(--segments)) for better maintainability.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const formatDisplayDate = useCallback((timestamp) => { | ||
| if (period === 'daily') return formatRelativeTime(timestamp); | ||
| const date = new Date(timestamp); | ||
| return isLandingMobile | ||
| ? date.toLocaleDateString(undefined, { month: 'numeric', day: 'numeric' }) | ||
| : date.toLocaleDateString(); | ||
| }, [period, isLandingMobile]); |
Copilot
AI
Nov 4, 2025
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.
[nitpick] The formatDisplayDate function should be memoized with useMemo instead of useCallback, since it's not being passed as a callback prop but is called directly within the JSX (line 433). Using useMemo would cache the function itself rather than its definition, though in practice this won't cause issues since the function is only called during rendering.
Summary
the statistics cards
subtle text-only glow with no background shift