Skip to content

Commit 9fdca20

Browse files
committed
Updates
1 parent 3f44f81 commit 9fdca20

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

apps/dashboard/src/lib/project-showcase-constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const PROJECT_SHOWCASE_DATA = [
77
slug: "artifact",
88
description:
99
"Blockchain-based platform for creating and trading digital art NFTs.",
10-
// image: "ipfs://QmQJrpMvLApCnoQaoXVd8Rb5Wyjn8u6c8Ei2rG6KawCwWS",
10+
image: "ipfs://QmQJrpMvLApCnoQaoXVd8Rb5Wyjn8u6c8Ei2rG6KawCwWS",
1111
industries: ["Art", "Games"],
1212
link: "https://www.gotartifact.com/",
1313
case_study: "No case study available",

apps/dashboard/src/pages/project-showcase/[slug].tsx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ import {
77
CardHeader,
88
CardTitle,
99
} from "@/components/ui/card";
10+
import { useThirdwebClient } from "@/constants/thirdweb.client";
11+
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
1012
import { ExternalLink, FileText } from "lucide-react";
1113
import Image from "next/image";
1214
import Link from "next/link";
1315
import { useRouter } from "next/router";
16+
import { ThirdwebProvider } from "thirdweb/react";
1417
import { PROJECT_SHOWCASE_DATA } from "../../lib/project-showcase-constants";
1518

16-
export default function DetailPage() {
19+
export function DetailPageUI() {
20+
const thirdwebClient = useThirdwebClient();
1721
const router = useRouter();
1822
const { slug } = router.query;
1923

@@ -69,9 +73,16 @@ export default function DetailPage() {
6973
</CardFooter>
7074
</div>
7175
<div className="md:w-1/2">
72-
<div className="relative aspect-video md:aspect-square w-full h-full">
76+
<div className="relative aspect-video h-full w-full md:aspect-square">
7377
<Image
74-
src={project.image}
78+
src={
79+
project.image?.startsWith("ipfs://")
80+
? (resolveSchemeWithErrorHandler({
81+
client: thirdwebClient,
82+
uri: project.image,
83+
}) ?? "")
84+
: ""
85+
}
7586
alt={`${project.title} Thumbnail`}
7687
layout="fill"
7788
objectFit="cover"
@@ -84,3 +95,11 @@ export default function DetailPage() {
8495
</div>
8596
);
8697
}
98+
99+
export default function DetailPage() {
100+
return (
101+
<ThirdwebProvider>
102+
<DetailPageUI />
103+
</ThirdwebProvider>
104+
);
105+
}

apps/dashboard/src/pages/project-showcase/index.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ import {
1717
PaginationNext,
1818
PaginationPrevious,
1919
} from "@/components/ui/pagination";
20+
import { useThirdwebClient } from "@/constants/thirdweb.client";
21+
import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
2022
import { ArrowRight } from "lucide-react";
2123
import Image from "next/image";
2224
import Link from "next/link";
2325
import { useState } from "react";
26+
import { ThirdwebProvider } from "thirdweb/react";
2427
import {
2528
PROJECT_SHOWCASE_DATA,
2629
PROJECT_SHOWCASE_INDUSTRIES,
2730
PROJECT_SHOWCASE_ITEMS_PER_PAGE,
2831
} from "../../lib/project-showcase-constants";
2932

30-
export default function ProjectShowcase() {
33+
export function ProjectShowcaseUI() {
34+
const thirdwebClient = useThirdwebClient();
3135
const [selectedIndustry, setSelectedIndustry] = useState("All");
3236
const [currentPage, setCurrentPage] = useState(1);
3337

@@ -94,7 +98,14 @@ export default function ProjectShowcase() {
9498
>
9599
<Card className="flex h-full cursor-pointer flex-col overflow-hidden transition-shadow hover:shadow-lg">
96100
<Image
97-
src={project.image || ""}
101+
src={
102+
project.image?.startsWith("ipfs://")
103+
? (resolveSchemeWithErrorHandler({
104+
client: thirdwebClient,
105+
uri: project.image,
106+
}) ?? "")
107+
: ""
108+
}
98109
alt={project.title}
99110
width={300}
100111
height={200}
@@ -170,3 +181,11 @@ export default function ProjectShowcase() {
170181
</div>
171182
);
172183
}
184+
185+
export default function ProjectShowcasePage() {
186+
return (
187+
<ThirdwebProvider>
188+
<ProjectShowcaseUI />
189+
</ThirdwebProvider>
190+
);
191+
}

0 commit comments

Comments
 (0)