diff --git a/.astro/settings.json b/.astro/settings.json index 82558a7e0..f2ee25df6 100644 --- a/.astro/settings.json +++ b/.astro/settings.json @@ -3,6 +3,6 @@ "enabled": false }, "_variables": { - "lastUpdateCheck": 1729612578122 + "lastUpdateCheck": 1730730439924 } } \ No newline at end of file diff --git a/src/components/Projects/ProjectCard.tsx b/src/components/Projects/ProjectCard.tsx index 1aaf99f85..2227ba793 100644 --- a/src/components/Projects/ProjectCard.tsx +++ b/src/components/Projects/ProjectCard.tsx @@ -12,6 +12,7 @@ type ProjectCardProps = { project: ProjectFileType; userCount?: number; status?: 'completed' | 'started' | 'none'; + avatar?: string; }; const badgeVariants: Record = { @@ -21,8 +22,9 @@ const badgeVariants: Record = { }; export function ProjectCard(props: ProjectCardProps) { - const { project, userCount = 0, status } = props; + const { project, userCount = 0, status, avatar } = props; const { frontmatter, id } = project; + const partnerAvatar = frontmatter.partner?.avatar; const isLoadingStatus = status === undefined; const userStartedCount = status !== 'none' && userCount === 0 ? userCount + 1 : userCount; @@ -46,8 +48,8 @@ export function ProjectCard(props: ProjectCardProps) { {isLoadingStatus ? ( <> - {' '} - {' '} + + ) : ( <> @@ -59,24 +61,41 @@ export function ProjectCard(props: ProjectCardProps) { <>Be the first to solve! )} - - {status !== 'none' && ( - + + {status !== 'none' && ( - {status} - - )} + className={cn( + 'flex items-center gap-1.5 rounded-full border border-current px-2 py-0.5 capitalize', + status === 'completed' && 'text-green-500', + status === 'started' && 'text-yellow-500', + )} + > + + {status} + + )} + {partnerAvatar && frontmatter.partner?.url && ( + e.stopPropagation()} + className="flex-shrink-0" + title={frontmatter.partner.name} + > + {`${frontmatter.partner.name} + + )} + )} diff --git a/src/lib/project.ts b/src/lib/project.ts index 011f829f7..1f02cfa81 100644 --- a/src/lib/project.ts +++ b/src/lib/project.ts @@ -23,6 +23,11 @@ export interface ProjectFrontmatter { ogImageUrl: string; }; roadmapIds: string[]; + partner?: { + name: string; + avatar: string; + url: string; + }; } export type ProjectFileType = MarkdownFileType & {