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..af17cc71a46671 100644 --- a/src/components/Profile-card/index.js +++ b/src/components/Profile-card/index.js @@ -6,34 +6,48 @@ 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 ProfileCard = (props) => { - const { name, status, image_path, meshmate } = props.frontmatter; - const link = props.cardlink; +const meshmateBadges = { + meshmate2020: Meshmate2020, + meshmate2021: Meshmate2021, +}; + +const ProfileCard = ({ frontmatter, cardlink }) => { + const { name, status, image_path, meshmate, badges } = frontmatter; + const link = cardlink; return (
- {name}/ - { meshmate === "yes" && ( - - meshmate-color-icon - - )} - {/* TODO: Code needs to be improved */} - { name === "Nikhil Ladha" && ( - - meshmate-color-icon - - )} - { name === "Aditya Chatterjee" && ( - - meshmate-color-icon - - )} + {name}

{name}

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