-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c8fc01
commit 6f4c7f7
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
packages/grant-explorer/src/features/common/ProjectCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |