-
-
Notifications
You must be signed in to change notification settings - Fork 185
feat: Improve ContributorCard UI — spacing, animations & dark-mode polish #354
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
base: main
Are you sure you want to change the base?
feat: Improve ContributorCard UI — spacing, animations & dark-mode polish #354
Conversation
|
Someone is attempting to deploy a commit to the shravan20's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. 💤 Files selected but had no reviewable changes (1)
You can disable this status message by setting the WalkthroughOverhauls ContributorCard to use theme-driven styling, responsive avatars, a new CTA, and a refined data-fetch validation flow. Expands themes.js with ten additional themes and a minor export formatting update. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Card as ContributorCard
participant API as Contributors API
participant Theme as Theme Provider
Note over Card,Theme: Initial render with theme-driven styles
User->>Card: Mount component
Card->>Theme: useTheme() for palette and styles
rect rgba(200,240,255,0.25)
Note right of Card: Fetch contributors on mount
Card->>API: GET /contributors
API-->>Card: JSON response
alt Valid array
Card->>Card: setContributors(list.slice(0,8))
else Invalid/Error
Card->>Card: setContributors([])
Card->>Card: console.error(...)
end
end
Card-->>User: Render avatars (≤8), counts, themed CTA
sequenceDiagram
autonumber
participant App as App
participant Theme as themes.js
participant UI as Themed Components
App->>Theme: Import themes
Theme-->>App: themes object (incl. 10 new entries)
App->>UI: Provide selected theme
UI-->>UI: Apply quote_color, author_color, bg_color
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/src/components/ContributorsCard/ContributorCard.js(2 hunks)src/themes/themes.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/themes/themes.js (2)
frontend/src/config/cardTemplate/index.js (2)
themes(1-47)themes(1-47)frontend/src/util/themes/index.js (1)
themes(1-242)
frontend/src/components/ContributorsCard/ContributorCard.js (1)
frontend/src/components/Dashboard/index.js (2)
theme(37-39)classes(40-40)
| // Helper function to check if a color is a gradient or image URL | ||
| const isComplexBackground = (bg) => bg && (bg.includes('gradient') || bg.includes('url')); |
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.
🛠️ Refactor suggestion | 🟠 Major
Remove unused helper.
isComplexBackground is declared but never used, leaving dead code in the module. Please drop it (or wire it up) to keep the component lean.
Apply this diff:
-// Helper function to check if a color is a gradient or image URL
-const isComplexBackground = (bg) => bg && (bg.includes('gradient') || bg.includes('url'));
-📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Helper function to check if a color is a gradient or image URL | |
| const isComplexBackground = (bg) => bg && (bg.includes('gradient') || bg.includes('url')); |
🤖 Prompt for AI Agents
In frontend/src/components/ContributorsCard/ContributorCard.js around lines
11-12, the helper isComplexBackground is declared but never used; remove the
entire helper declaration to eliminate dead code, or alternatively replace the
inline background check wherever background strings are handled with a call to
isComplexBackground(bg) so the helper is actually used and duplicate logic is
removed.
Summary
This PR refreshes the
ContributorCardUI to improve spacing, visual hierarchy, and interactive feedback across light and dark modes. It also cleans up the component source by removing inline comments and stray duplicated code that caused lint/compile noise.Changes
Updated
frontend/src/components/ContributorsCard/ContributorCard.js:theme.spacingfor consistent layout.Minor theme adjustments in
src/themes/themes.jsto ensure contrast in dark mode (no breaking changes).Why this helps
Testing notes
cd frontend && npm install && npm startand visit the app to verify visual changes.Checklist
If you'd like I can split this into smaller PRs (styling-only vs cleanup) — happy to adapt.
Summary by CodeRabbit
New Features
Style
Bug Fixes
Accessibility