From f58968764b6f9c92012fcb26bdf18be7a3b0e968 Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar Date: Wed, 15 Nov 2023 21:35:52 +0530 Subject: [PATCH] feat: project page cards ready? --- src/components/ProjectCard.tsx | 110 ++++++++++++++++++--------------- src/util/types.ts | 1 + 2 files changed, 60 insertions(+), 51 deletions(-) diff --git a/src/components/ProjectCard.tsx b/src/components/ProjectCard.tsx index b029501b..9be0f61f 100644 --- a/src/components/ProjectCard.tsx +++ b/src/components/ProjectCard.tsx @@ -1,72 +1,80 @@ -import { IProject, IProjectTags } from "../util/types"; -import projectTags from "../data/projectTags.json"; +import { IoPersonSharp } from "react-icons/io5"; +import { IProject } from "../util/types"; function ProjectCard({ name, description, tags, mentor, + secondary_mentor, comm_channel, repo_link, }: IProject) { - function getColor(tag: string) { - if (tag in projectTags) { - return (projectTags as IProjectTags)[tag]; - } else { - const randomColorIndex = Math.floor( - Math.random() * Object.keys(projectTags as IProjectTags).length, - ); - const randomKey = Object.keys(projectTags as IProjectTags)[ - randomColorIndex - ]; - return (projectTags as IProjectTags)[randomKey]; - } - } return ( <> -
-

{name}

-

- Mentor:{" "} - - {mentor.name} - -

-

- {description} -

-
- {tags - .sort() - .slice(0, 6) - .map((tag, i) => ( - +
+
+

{name}

+
+ {tags.map((tag) => ( +

{tag} - +

))} +
+
+ +

{description}

+ + -
- - +
diff --git a/src/util/types.ts b/src/util/types.ts index 4cc1e396..25174b26 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -72,6 +72,7 @@ export interface IProject { comm_channel: string; readme_link: string; mentor: IMentor; + secondary_mentor: IMentor; } interface IProjectReg {