Skip to content

Commit

Permalink
feat: add project card
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavaparoksham committed Jun 18, 2024
1 parent 7c8fc01 commit 6f4c7f7
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions packages/grant-explorer/src/features/common/ProjectCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { v2Project } from "data-layer";
import { BasicCard, CardContent, CardDescription, CardHeader } from "./styles";
import { projectPath } from "common/src/routes/explorer";
import { ProjectBanner, ProjectLogo } from "./ProjectBanner";

export function ProjectCard(props: { project: v2Project }): JSX.Element {
const { project } = props;

return (
<BasicCard className="w-full hover:opacity-90 transition hover:shadow-none">
<a
target="_blank"
href={projectPath({
projectId: project.id,
})}
data-track-event="project-card"
>
<CardHeader className="relative">
<ProjectBanner
bannerImgCid={project.metadata.bannerImg ?? null}
classNameOverride={
"bg-black h-[120px] w-full object-cover rounded-t"
}
resizeHeight={120}
/>
</CardHeader>
<CardContent className="relative">
{project.metadata.logoImg !== undefined && (
<ProjectLogo
className="border-solid border-2 border-white absolute -top-[24px] "
imageCid={project.metadata.logoImg}
size={48}
/>
)}
<div className="truncate mt-4">{project.name}</div>
<CardDescription className=" min-h-[96px]">
<div className="text-sm line-clamp-4">
{project.metadata.description}
</div>
</CardDescription>
</CardContent>
</a>
</BasicCard>
);
}

0 comments on commit 6f4c7f7

Please sign in to comment.