Skip to content

Conversation

@Priyanshu2004-Singh
Copy link

@Priyanshu2004-Singh Priyanshu2004-Singh commented Oct 11, 2025

Summary

This PR refreshes the ContributorCard UI 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:

    • Modernized gradients for light/dark backgrounds.
    • Replaced hard-coded spacing with theme.spacing for consistent layout.
    • Increased title size/weight for better hierarchy.
    • Added avatar borders and hover scale + shadow for clearer affordance.
    • Redesigned CTA button as a pill with gradient background and improved hover animation.
    • Removed comments and fixed duplicated/trailing code.
  • Minor theme adjustments in src/themes/themes.js to ensure contrast in dark mode (no breaking changes).

Why this helps

  • Improves UX and visual polish for contributors listing.
  • Makes the component easier to maintain andreduces lint warnings.
  • Ensures consistent spacing tied to the Material-UI theme.

Testing notes

  • Run cd frontend && npm install && npm start and visit the app to verify visual changes.
  • Confirm contributors load (GitHub API call) and the CTA still links to the contributors page.

Checklist

  • Frontend starts and loads correctly
  • Contributors list displays avatars and counts
  • Visual check in both light and dark modes

Summary by CodeRabbit

  • New Features

    • Added “View All Contributors” button on the Contributors card.
    • Expanded visible contributor avatars to up to 8.
    • Introduced 10 new visual themes: catppuccin-mocha, rose-pine, ayu-light, fire-opal, hacker-green, lavender-dawn, azure, old-book, neon-blaze, forest-path.
  • Style

    • Redesigned Contributors card with theme-aware colors, gradients, shadows, and smoother hover effects.
    • Updated typography and avatar styling for better readability and interactivity.
  • Bug Fixes

    • Improved contributors data validation; shows empty state on errors.

Priyanshu Singh and others added 2 commits October 11, 2025 21:49
…ntributor-card

feat(ui): refresh ContributorCard UI — spacing, animations, and dark-mode polish
@vercel
Copy link

vercel bot commented Oct 11, 2025

@Priyanshu2004-Singh is attempting to deploy a commit to the shravan20's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Oct 11, 2025

Walkthrough

Updates the ContributorsCard component to use theme-driven styles, revised layout, and enhanced actions, plus improved contributor data validation and error handling. Adds ten new theme definitions to the themes export with colors/gradients and minor formatting tweaks to the export statement.

Changes

Cohort / File(s) Summary
ContributorsCard theming and UI refresh
frontend/src/components/ContributorsCard/ContributorCard.js
Integrates useTheme; rewrites styles with theme palette/spacing and light/dark branches; updates title/subtitle, avatar list (now up to 8), and actions with a new “View All Contributors” button; adds hover/gradient effects; validates fetch results (array check), resets on error; minor margin adjustments.
Theme catalog expansion
src/themes/themes.js
Adds 10 themes (catppuccin-mocha, rose-pine, ayu-light, fire-opal, hacker-green, lavender-dawn, azure, old-book, neon-blaze, forest-path) with quote/author/bg colors and gradients; comment headers; consistent trailing commas; export spacing updated to module.exports = themes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant CC as ContributorsCard
  participant API as Contributors API

  U->>CC: Mount component
  CC->>API: fetchContributors()
  alt Success
    API-->>CC: data (array)
    CC->>CC: validate array<br/>setContributors(list)
    CC-->>U: Render avatars, title, subtitle, button
  else Error or non-array
    API--x CC: error / invalid
    CC->>CC: setContributors([])<br/>log error
    CC-->>U: Render empty state with actions
  end

  U->>CC: Click "View All Contributors"
  CC->>U: Navigate/open contributors view (per router/config)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paws on gradients bright,
New themes bloom softly in dawn’s light.
Avatars twirl with a hover gleam,
Buttons beckon—join the team!
If fetch goes awry, we still hop true—
Ears up, code snug, and carrots anew. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately reflects the primary updates by summarizing the modernized UI enhancements and the addition of ten new themes, directly matching the main changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
frontend/src/components/ContributorsCard/ContributorCard.js (2)

16-105: Consider extracting hardcoded colors to theme palette.

While the theme-driven layout and spacing improvements are excellent, several colors remain hardcoded (e.g., gradients on lines 23-25, border colors on line 29, avatar borders on line 66, button gradients on lines 82-84). This makes it harder to customize these values across themes without modifying component code.

If you plan to support the newly added themes from src/themes/themes.js, consider defining these UI colors in the Material-UI theme palette so they can be overridden per theme.

Example approach for a single color:

In your theme definition (e.g., in Dashboard where createTheme is called):

const theme = createTheme({
  palette: {
    type: 'dark',
    primary: { main: '#2ea043' },
    // Add custom colors for the card
    custom: {
      cardGradientStart: '#1c2128',
      cardGradientEnd: '#0d1117',
      avatarBorder: '#2ea043',
      buttonGradientStart: '#2ea043',
      buttonGradientEnd: '#34bf49',
    }
  }
});

Then reference in the component:

-  background: theme.palette.type === 'dark' 
-    ? 'linear-gradient(135deg, #1c2128 0%, #0d1117 100%)'
-    : 'linear-gradient(135deg, #ffffff 0%, #f7f7f7 100%)',
+  background: theme.palette.type === 'dark'
+    ? `linear-gradient(135deg, ${theme.palette.custom.cardGradientStart} 0%, ${theme.palette.custom.cardGradientEnd} 100%)`
+    : 'linear-gradient(135deg, #ffffff 0%, #f7f7f7 100%)',

169-169: Simplify slice logic (optional).

The Math.min(listOfContributors.length, 8) is redundant because slice(0, 8) already handles arrays shorter than 8 elements safely.

Apply this diff for a cleaner implementation:

-  listOfContributors.slice(0, Math.min(listOfContributors.length, 8)).map((contributor) => {
+  listOfContributors.slice(0, 8).map((contributor) => {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc57607 and 5be32ab.

📒 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)
frontend/src/components/ContributorsCard/ContributorCard.js (1)
frontend/src/components/Dashboard/index.js (2)
  • theme (37-39)
  • classes (40-40)
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)
🔇 Additional comments (3)
src/themes/themes.js (1)

334-334: LGTM!

Formatting improvement adds spaces around the assignment operator for consistency.

frontend/src/components/ContributorsCard/ContributorCard.js (2)

125-134: Excellent error handling and data validation!

The array validation ensures the component handles unexpected API responses gracefully, and resetting to an empty array on error prevents crashes from undefined data.


148-161: Verify emoji accessibility and glow effect.

The heart emoji with conditional glow is a nice touch. However, ensure:

  1. Accessibility: The role="img" and aria-label="heart" are correct for screen readers.
  2. Visual consistency: The drop-shadow filter creates a glow in dark mode only. Test that this effect displays consistently across browsers (some older browsers have limited filter support).

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.

1 participant