From 7e73c344f5ac25d4e5ae7701db1f4500b135e79a Mon Sep 17 00:00:00 2001 From: MananTank Date: Wed, 2 Jul 2025 20:15:47 +0000 Subject: [PATCH] Dashboard: asset page header: hide zero-address, fix icon (#7514) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on improving the handling of wallet addresses and token fetching in the application. It enhances the rendering of wallet address components and modifies the fetching logic for token information, including error handling. ### Detailed summary - Updated rendering of the wallet address in `apps/dashboard/src/@/components/blocks/wallet-address.tsx` and `apps/nebula/src/@/components/blocks/wallet-address.tsx` to include `props.className` and added a `text-xs` class in the latter. - Enhanced the fetch request in `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_utils/fetch-coin-info.ts` by moving `clientId` to headers and added error logging for failed requests. - Modified the condition for rendering contract creator in `apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx` to check if `contractCreator` is not equal to `ZERO_ADDRESS`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit * **New Features** * Improved wallet address display to support external styling and smaller text size for the zero address. * **Bug Fixes** * Updated contract header to ensure the contract creator badge is not shown for zero addresses. * Enhanced error logging for token info fetching to aid in troubleshooting. --- .../src/@/components/blocks/wallet-address.tsx | 6 +++++- .../public-pages/erc20/_components/ContractHeader.tsx | 4 ++-- .../public-pages/erc20/_utils/fetch-coin-info.ts | 10 +++++++++- apps/nebula/src/@/components/blocks/wallet-address.tsx | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/dashboard/src/@/components/blocks/wallet-address.tsx b/apps/dashboard/src/@/components/blocks/wallet-address.tsx index 1703458514c..94c90837c8d 100644 --- a/apps/dashboard/src/@/components/blocks/wallet-address.tsx +++ b/apps/dashboard/src/@/components/blocks/wallet-address.tsx @@ -59,7 +59,11 @@ export function WalletAddress(props: { // special case for zero address if (address === ZERO_ADDRESS) { - return {shortenedAddress}; + return ( + + {shortenedAddress} + + ); } return ( diff --git a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx index 8d2ac72f937..28bb90f2014 100644 --- a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx +++ b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.tsx @@ -1,7 +1,7 @@ import { ExternalLinkIcon, GlobeIcon, Settings2Icon } from "lucide-react"; import Link from "next/link"; import { useMemo } from "react"; -import type { ThirdwebContract } from "thirdweb"; +import { type ThirdwebContract, ZERO_ADDRESS } from "thirdweb"; import type { ChainMetadata } from "thirdweb/chains"; import { Img } from "@/components/blocks/Img"; import { Button } from "@/components/ui/button"; @@ -149,7 +149,7 @@ export function ContractHeaderUI(props: { {/* bottom row */}
- {props.contractCreator && ( + {props.contractCreator && props.contractCreator !== ZERO_ADDRESS && ( {shortenedAddress}; + return ( + + {shortenedAddress} + + ); } return (