Refactor ProfileCard to render Meshmate badges dynamically via frontm… - #7893
Refactor ProfileCard to render Meshmate badges dynamically via frontm…#7893debkarma wants to merge 2 commits into
Conversation
…atter Signed-off-by: Debajyoti Karmakar <debkarma97@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe profile adds a ChangesDynamic Meshmate badges
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Profile-card/index.js`:
- Around line 29-42: Update the badge image alt text in the badges.map callback
of the Profile card so it identifies the specific badge represented by each
badge key, such as “MeshMate 2020 badge” or “MeshMate 2021 badge,” instead of
using the same generic text for every image. Keep the existing generic icon
behavior unchanged.
- Around line 14-16: Update the ProfileCard component signature to destructure
frontmatter and cardlink directly from its props, then derive name, status,
image_path, meshmate, and badges from the destructured frontmatter while using
cardlink directly. Remove the intermediate props access and preserve the
existing rendering behavior.
- Around line 20-43: Move the badge link rendering in the profile-card component
outside the outer Link to={link}, including the meshmate and mapped badge links,
so they are not nested anchors. Preserve each badge’s existing
/community/meshmates destination and rendering behavior while keeping the
profile content linked through the outer Link.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2ae90766-cf64-41d6-a8ab-0524815a052f
📒 Files selected for processing (2)
src/collections/members/aditya-chatterjee/index.mdxsrc/components/Profile-card/index.js
Signed-off-by: Debajyoti Karmakar <debkarma97@gmail.com>
Description
This PR fixes #7885
The
ProfileCardcomponent was previously using hardcoded member names (e.g.name === "Nikhil Ladha") to conditionally render "Meshmate of the Year" SVG badges.This PR refactors the logic to be completely dynamic:
meshmateBadgesdictionary to map badge strings to their imported SVGs.badgesarray passed from the member's markdown frontmatter.meshmate2020ormeshmate2021), the corresponding SVG is rendered.meshmate2021badge toaditya-chatterjee/index.mdxso his badge renders correctly without hardcoding his name.Signed commits
Summary by CodeRabbit