Skip to content

Commit 85649c2

Browse files
committed
Shorten Published image publisher address in OG image
1 parent 975cd0b commit 85649c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/utils/publishedContractOGImageTemplate.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/* eslint-disable @next/next/no-img-element */
22
import { getThirdwebClient } from "@/constants/thirdweb.server";
33
import { ImageResponse } from "next/og";
4+
import { isAddress } from "thirdweb";
45
import { download } from "thirdweb/storage";
6+
import { shortenAddress } from "thirdweb/utils";
57

68
const OgBrandIcon: React.FC = () => (
79
// biome-ignore lint/a11y/noSvgWithoutTitle: not needed
@@ -255,7 +257,9 @@ export async function publishedContractOGImageTemplate(params: {
255257
)}
256258

257259
<h2 tw="text-2xl text-white font-medium max-w-full">
258-
{params.publisher}
260+
{isAddress(params.publisher)
261+
? shortenAddress(params.publisher)
262+
: params.publisher}
259263
</h2>
260264
</div>
261265
</div>

0 commit comments

Comments
 (0)