Skip to content

Commit 1a71de0

Browse files
committed
Fix broken Contract metadata image (#4031)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to enhance the `MetadataHeader` component by adding a new function `resolveScheme` to handle image URIs with a thirdweb client. ### Detailed summary - Added `resolveScheme` function import from `thirdweb/storage` - Modified `src` attribute in `Image` component to use `resolveScheme` for handling image URIs > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent b0494f6 commit 1a71de0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/dashboard/src/components/custom-contract/contract-header/metadata-header.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { thirdwebClient } from "@/constants/client";
12
import {
23
Center,
34
Flex,
@@ -8,6 +9,7 @@ import {
89
import { ChainIcon } from "components/icons/ChainIcon";
910
import Link from "next/link";
1011
import type { ChainMetadata } from "thirdweb/chains";
12+
import { resolveScheme } from "thirdweb/storage";
1113
import { Heading, LinkButton, Text } from "tw-components";
1214
import { AddressCopyButton } from "tw-components/AddressCopyButton";
1315

@@ -77,7 +79,10 @@ export const MetadataHeader: React.FC<MetadataHeaderProps> = ({
7779
right={0}
7880
left={0}
7981
objectFit="contain"
80-
src={data.image}
82+
src={resolveScheme({
83+
client: thirdwebClient,
84+
uri: data.image,
85+
})}
8186
alt={data?.name?.toString() || ""}
8287
/>
8388
) : null}

0 commit comments

Comments
 (0)