Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/collections/members/aditya-chatterjee/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
54 changes: 34 additions & 20 deletions src/components/Profile-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ProfileCardWrapper status={status}>
<div className="profile-card">
<Link to={link}>
<header>
<Image {...image_path} imgStyle={{ objectFit: "contain" }} alt={name}/>
{ meshmate === "yes" && (
<Link className="meshmate" to="/community/meshmates">
<img src={MeshMateIcon} alt="meshmate-color-icon" />
</Link>
)}
{/* TODO: Code needs to be improved */}
{ name === "Nikhil Ladha" && (
<Link className="meshmate" to="/community/meshmates">
<img src={Meshmate2020} alt="meshmate-color-icon" />
</Link>
)}
{ name === "Aditya Chatterjee" && (
<Link className="meshmate" to="/community/meshmates">
<img src={Meshmate2021} alt="meshmate-color-icon" />
</Link>
)}
<Image
{...image_path}
imgStyle={{ objectFit: "contain" }}
alt={name}
/>
<h4>{name}</h4>
</header>
</Link>
{meshmate === "yes" && (
<Link className="meshmate" to="/community/meshmates">
<img src={MeshMateIcon} alt="meshmate-color-icon" />
</Link>
)}
{badges &&
badges.map((badge) => {
const BadgeIcon = meshmateBadges[badge];
if (BadgeIcon) {
return (
<Link
key={badge}
className="meshmate"
to="/community/meshmates"
>
<img src={BadgeIcon} alt={`${badge} badge`} />
</Link>
);
}
return null;
})}
</div>
</ProfileCardWrapper>
);
Expand Down