Skip to content

Commit 363b633

Browse files
authored
[Very minor patch] Add case study button to card (#5181)
1 parent 4ec2aa8 commit 363b633

File tree

1 file changed

+49
-33
lines changed
  • apps/dashboard/src/app/project-showcase

1 file changed

+49
-33
lines changed

apps/dashboard/src/app/project-showcase/page.tsx

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { FileText } from "lucide-react";
12
import type { Metadata } from "next";
23
import Image from "next/image";
34
import Link from "next/link";
45
import { Badge } from "../../@/components/ui/badge";
6+
import { Button } from "../../@/components/ui/button";
57
import {
68
Card,
79
CardContent,
@@ -127,43 +129,57 @@ export default function ProjectShowcasePage({
127129
</div>
128130
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
129131
{paginatedProjects.map((project) => (
130-
<Link
131-
key={project.id}
132-
href={`/project-showcase/${project.slug}`}
133-
className="block"
134-
>
132+
<div key={project.id} className="block">
135133
<Card className="flex h-full cursor-pointer flex-col overflow-hidden transition-shadow hover:shadow-lg">
136-
{/* eslint-disable @next/next/no-img-element */}
137-
<img
138-
src={
139-
project.image?.startsWith("ipfs://")
140-
? (resolveSchemeWithErrorHandler({
141-
client: getThirdwebClient(),
142-
uri: project.image,
143-
}) ?? "")
144-
: (project.image ??
145-
"/assets/showcase/default_image.png")
146-
}
147-
alt={project.title}
148-
width={300}
149-
height={200}
150-
className="h-48 w-full object-cover"
151-
/>
152-
<CardHeader>
153-
<CardTitle className="mb-3">{project.title}</CardTitle>
154-
<CardDescription>{project.description}</CardDescription>
155-
</CardHeader>
156-
<CardContent className="flex-grow">
157-
<div className="flex flex-wrap gap-2">
158-
{project.industries?.map((industry) => (
159-
<Badge key={industry} variant="secondary">
160-
{industry}
161-
</Badge>
162-
))}
134+
<Link
135+
href={`/project-showcase/${project.slug}`}
136+
className="flex-grow"
137+
>
138+
{/* eslint-disable @next/next/no-img-element */}
139+
<img
140+
src={
141+
project.image?.startsWith("ipfs://")
142+
? (resolveSchemeWithErrorHandler({
143+
client: getThirdwebClient(),
144+
uri: project.image,
145+
}) ?? "")
146+
: (project.image ??
147+
"/assets/showcase/default_image.png")
148+
}
149+
alt={project.title}
150+
width={300}
151+
height={200}
152+
className="h-48 w-full object-cover"
153+
/>
154+
<CardHeader>
155+
<CardTitle className="mb-3">{project.title}</CardTitle>
156+
<CardDescription>{project.description}</CardDescription>
157+
</CardHeader>
158+
</Link>
159+
<CardContent>
160+
<div className="flex items-center justify-between">
161+
<div className="flex flex-wrap gap-2">
162+
{project.industries?.map((industry) => (
163+
<Badge key={industry} variant="secondary">
164+
{industry}
165+
</Badge>
166+
))}
167+
</div>
168+
{project.case_study && (
169+
<Link
170+
href={project.case_study}
171+
target="_blank"
172+
// onClick={(e) => e.stopPropagation()}
173+
>
174+
<Button variant="outline" size="sm">
175+
<FileText className="mr-2 h-4 w-4" /> Case Study
176+
</Button>
177+
</Link>
178+
)}
163179
</div>
164180
</CardContent>
165181
</Card>
166-
</Link>
182+
</div>
167183
))}
168184
</div>
169185
<div className="mt-8 flex flex-col items-center">

0 commit comments

Comments
 (0)