From c1cc6f4e978feff4eedd6d15f872c986a58c5d66 Mon Sep 17 00:00:00 2001 From: Debajyoti Karmakar Date: Mon, 27 Jul 2026 22:37:35 +0530 Subject: [PATCH 1/2] Refactor ProfileCard to render Meshmate badges dynamically via frontmatter Signed-off-by: Debajyoti Karmakar --- .../members/aditya-chatterjee/index.mdx | 1 + src/components/Profile-card/index.js | 42 ++++++++++++------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/collections/members/aditya-chatterjee/index.mdx b/src/collections/members/aditya-chatterjee/index.mdx index 1ecf662a777cdf..81e6345f82a2c3 100644 --- a/src/collections/members/aditya-chatterjee/index.mdx +++ b/src/collections/members/aditya-chatterjee/index.mdx @@ -11,6 +11,7 @@ bio: 3rd Year CS undergrad of KIIT, Bhubaneswar. Navigating his way through the badges: - community - meshery + - meshmate2021 status: Inactive meshmate: yes emeritus: yes diff --git a/src/components/Profile-card/index.js b/src/components/Profile-card/index.js index 4003df2e178efb..83cfef68ee0a8a 100644 --- a/src/components/Profile-card/index.js +++ b/src/components/Profile-card/index.js @@ -6,31 +6,45 @@ import Meshmate2020 from "../../assets/images/meshmate-of-the-year/meshmate-of-t import Meshmate2021 from "../../assets/images/meshmate-of-the-year/meshmate-of-the-year-2021.svg"; import Image from "../image"; +const meshmateBadges = { + meshmate2020: Meshmate2020, + meshmate2021: Meshmate2021, +}; + const ProfileCard = (props) => { - const { name, status, image_path, meshmate } = props.frontmatter; + const { name, status, image_path, meshmate, badges } = props.frontmatter; const link = props.cardlink; return (
- {name}/ - { meshmate === "yes" && ( + {name} + {meshmate === "yes" && ( meshmate-color-icon )} - {/* TODO: Code needs to be improved */} - { name === "Nikhil Ladha" && ( - - meshmate-color-icon - - )} - { name === "Aditya Chatterjee" && ( - - meshmate-color-icon - - )} + {badges && + badges.map((badge) => { + const BadgeIcon = meshmateBadges[badge]; + if (BadgeIcon) { + return ( + + meshmate-color-icon + + ); + } + return null; + })}

{name}

From 2d8163244bd01b7ed82629d22cc2b33a01806f1b Mon Sep 17 00:00:00 2001 From: Debajyoti Karmakar Date: Mon, 27 Jul 2026 23:02:11 +0530 Subject: [PATCH 2/2] Implement CodeRabbit review feedback Signed-off-by: Debajyoti Karmakar --- src/components/Profile-card/index.js | 48 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/Profile-card/index.js b/src/components/Profile-card/index.js index 83cfef68ee0a8a..af17cc71a46671 100644 --- a/src/components/Profile-card/index.js +++ b/src/components/Profile-card/index.js @@ -11,9 +11,9 @@ const meshmateBadges = { meshmate2021: Meshmate2021, }; -const ProfileCard = (props) => { - const { name, status, image_path, meshmate, badges } = props.frontmatter; - const link = props.cardlink; +const ProfileCard = ({ frontmatter, cardlink }) => { + const { name, status, image_path, meshmate, badges } = frontmatter; + const link = cardlink; return (
@@ -24,30 +24,30 @@ const ProfileCard = (props) => { imgStyle={{ objectFit: "contain" }} alt={name} /> - {meshmate === "yes" && ( - - meshmate-color-icon - - )} - {badges && - badges.map((badge) => { - const BadgeIcon = meshmateBadges[badge]; - if (BadgeIcon) { - return ( - - meshmate-color-icon - - ); - } - return null; - })}

{name}

+ {meshmate === "yes" && ( + + meshmate-color-icon + + )} + {badges && + badges.map((badge) => { + const BadgeIcon = meshmateBadges[badge]; + if (BadgeIcon) { + return ( + + {`${badge} + + ); + } + return null; + })}
);