From b37ed5736576a90e4d8d923022dda383df478693 Mon Sep 17 00:00:00 2001 From: MananTank Date: Mon, 22 Sep 2025 18:59:27 +0000 Subject: [PATCH] Dashboard: Fix broken opengraph-image.tsx (#8094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on refactoring the use of `useId` in several components by replacing it with static string values for IDs, improving consistency and potentially performance in the components related to Open Graph images. ### Detailed summary - Removed `useId` from `contract-wallet-analytics.ts`, replacing it with a static variable. - Updated `TWLogo` component in `opengraph-image.tsx` to use static IDs instead of `useId`. - Changed `OgBrandIcon` component in `opengraph-image.tsx` to use a static gradient ID. - Updated `TWLogo` component in another `opengraph-image.tsx` file to use static IDs instead of `useId`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit - New Features - None. - Bug Fixes - Improved reliability of OpenGraph images by using stable SVG IDs for gradients and clip paths, ensuring consistent rendering across sharing platforms on chain, contract, and drop pages. - Chores - Removed unnecessary debug logging from wallet analytics to reduce console noise. --- .../(chain)/[chain_id]/(chainPage)/opengraph-image.tsx | 5 ++--- .../analytics/utils/contract-wallet-analytics.ts | 1 - .../(chain)/[chain_id]/[contractAddress]/opengraph-image.tsx | 4 ++-- .../dashboard/src/app/(app)/drops/[slug]/opengraph-image.tsx | 5 ++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/opengraph-image.tsx b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/opengraph-image.tsx index 3b7c24ac2e0..9462270abfe 100644 --- a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/opengraph-image.tsx +++ b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/opengraph-image.tsx @@ -1,5 +1,4 @@ import { ImageResponse } from "next/og"; -import { useId } from "react"; import { download } from "thirdweb/storage"; import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs"; import { getConfiguredThirdwebClient } from "@/constants/thirdweb.server"; @@ -18,8 +17,8 @@ export const size = { export const contentType = "image/png"; const TWLogo: React.FC = () => { - const clipPathId = useId(); - const linearGradientId = useId(); + const clipPathId = "og-tw-logo-clip-path"; + const linearGradientId = "og-tw-logo-linear-gradient"; return ( // biome-ignore lint/a11y/noSvgWithoutTitle: not needed { - const gradientId = useId(); return ( // biome-ignore lint/a11y/noSvgWithoutTitle: not needed { - const cipId = useId(); - const linearGradientId = useId(); + const cipId = "og-tw-logo-clip-path"; + const linearGradientId = "og-tw-logo-linear-gradient"; return ( // biome-ignore lint/a11y/noSvgWithoutTitle: not needed