diff --git a/nt-fe/app/(treasury)/[treasuryId]/members/components/member-review-step.tsx b/nt-fe/app/(treasury)/[treasuryId]/members/components/member-review-step.tsx index 3622af16..414f9b6d 100644 --- a/nt-fe/app/(treasury)/[treasuryId]/members/components/member-review-step.tsx +++ b/nt-fe/app/(treasury)/[treasuryId]/members/components/member-review-step.tsx @@ -118,6 +118,7 @@ export function MemberReviewStep({ accountId={member.accountId} variant="details" withLink={false} + truncateAddress={false} /> ) : ( diff --git a/nt-fe/app/(treasury)/[treasuryId]/members/join-requests/page.tsx b/nt-fe/app/(treasury)/[treasuryId]/members/join-requests/page.tsx index 2a43aef5..b4ad1860 100644 --- a/nt-fe/app/(treasury)/[treasuryId]/members/join-requests/page.tsx +++ b/nt-fe/app/(treasury)/[treasuryId]/members/join-requests/page.tsx @@ -122,7 +122,7 @@ function JoinRequestsAssignStep({ size="md" variant="details" withLink={false} - withHoverCard + truncateAddress={false} /> + ) : ( +
+ ) + ) : ( + + {nameIsAddress ? primaryText : visibleAddress} + + ); + const content = ( <> {showAvatar && ( @@ -241,20 +280,16 @@ export function UserWithData({ /> )} {showDetails && ( -
+
{nameIsAddress ? ( - highlightQuery ? ( - - ) : ( -
- ) + addressNode ) : ( <> - {highlightQuery ? ( - - ) : ( -
- )} + {addressNode} )}
@@ -425,6 +449,8 @@ interface UserProps { preferAddressBook?: boolean; /** When set, matching substrings in name/address are highlighted. */ highlightQuery?: string; + /** When false, show the full address (no middle ellipsis). Default true. */ + truncateAddress?: boolean; } export function User({ @@ -438,6 +464,7 @@ export function User({ chainName = NEAR_NETWORK_ID, preferAddressBook = false, highlightQuery, + truncateAddress = true, }: UserProps) { const bareAccountId = stripNearComAddressPrefix(accountId); const { data: profile, isLoading } = useProfile(bareAccountId); @@ -466,6 +493,7 @@ export function User({ withHoverCard={withHoverCard} chainName={chainName} highlightQuery={highlightQuery} + truncateAddress={truncateAddress} /> ); } diff --git a/nt-fe/features/activity/components/activity-table.tsx b/nt-fe/features/activity/components/activity-table.tsx index 8257c958..e76af6a8 100644 --- a/nt-fe/features/activity/components/activity-table.tsx +++ b/nt-fe/features/activity/components/activity-table.tsx @@ -26,8 +26,9 @@ import { import { TableSkeleton } from "@/components/table-skeleton"; import { TokenAmountDisplay } from "@/components/token-display"; import { TokenDisplay } from "@/components/token-display-with-network"; +import { Address } from "@/components/address"; import { Tooltip } from "@/components/tooltip"; -import { User } from "@/components/user"; +import { TooltipUser } from "@/components/user"; import { useTreasury } from "@/hooks/use-treasury"; import type { RecentActivity } from "@/lib/api"; import { cn, formatActivityAmount, formatSmartAmount } from "@/lib/utils"; @@ -355,16 +356,18 @@ export function ActivityTable({ {fromId ? ( - + > +
+ ) : ( {getFromAccount( @@ -378,16 +381,18 @@ export function ActivityTable({ {toId ? ( - + > +
+ ) : ( {getToAccount( diff --git a/nt-fe/features/proposals/components/expanded-view/batch-payment-expanded.tsx b/nt-fe/features/proposals/components/expanded-view/batch-payment-expanded.tsx index 25261873..897d3f38 100644 --- a/nt-fe/features/proposals/components/expanded-view/batch-payment-expanded.tsx +++ b/nt-fe/features/proposals/components/expanded-view/batch-payment-expanded.tsx @@ -100,6 +100,7 @@ function PaymentDisplay({ accountId={payment.recipient} displayAddress={displayRecipient} chainName={chainName} + withHoverCard preferAddressBook /> ), diff --git a/nt-fe/features/proposals/components/proposals-table.tsx b/nt-fe/features/proposals/components/proposals-table.tsx index c4eb9269..88ae16f5 100644 --- a/nt-fe/features/proposals/components/proposals-table.tsx +++ b/nt-fe/features/proposals/components/proposals-table.tsx @@ -31,7 +31,8 @@ import { Policy } from "@/types/policy"; import { TreasuryConfig } from "@/lib/api"; import { FormattedDate } from "@/components/formatted-date"; -import { User } from "@/components/user"; +import { Address } from "@/components/address"; +import { TooltipUser } from "@/components/user"; import { Checkbox } from "@/components/ui/checkbox"; import { getProposalStatus, getProposalUIKind } from "../utils/proposal-utils"; import { useProposalKindLabel } from "../hooks/use-proposal-kind-label"; @@ -339,12 +340,9 @@ export function ProposalsTable({ cell: (info) => { const value = info.getValue(); return ( - + +
+ ); }, }), diff --git a/nt-fe/features/proposals/components/transaction-cell/function-call-cell.tsx b/nt-fe/features/proposals/components/transaction-cell/function-call-cell.tsx index 80b7d089..29c3c031 100644 --- a/nt-fe/features/proposals/components/transaction-cell/function-call-cell.tsx +++ b/nt-fe/features/proposals/components/transaction-cell/function-call-cell.tsx @@ -1,8 +1,6 @@ import { useTranslations } from "next-intl"; import { FunctionCallData } from "../../types/index"; import { TitleSubtitleCell } from "./title-subtitle-cell"; -import { useProfile } from "@/hooks/use-treasury-queries"; -import { resolveUserDisplayName } from "@/components/user"; interface FunctionCallCellProps { data: FunctionCallData; @@ -12,12 +10,7 @@ interface FunctionCallCellProps { export function FunctionCallCell({ data, timestamp }: FunctionCallCellProps) { const t = useTranslations("proposals.expanded"); - const { data: profile } = useProfile(data.receiver); - const receiver = resolveUserDisplayName({ - accountId: data.receiver, - profileName: profile?.name, - }); - const subtitle = t("onReceiver", { receiver }); + const subtitle = t("onReceiver", { receiver: data.receiver }); const title = data.actions.length === 1 ? data.actions[0].methodName diff --git a/nt-fe/features/proposals/components/transaction-cell/staking-cell.tsx b/nt-fe/features/proposals/components/transaction-cell/staking-cell.tsx index 64503e35..d3d14043 100644 --- a/nt-fe/features/proposals/components/transaction-cell/staking-cell.tsx +++ b/nt-fe/features/proposals/components/transaction-cell/staking-cell.tsx @@ -1,11 +1,10 @@ import { useTranslations } from "next-intl"; import { TokenCell } from "./token-cell"; import { StakingData } from "../../types/index"; -import { useLockupPool, useProfile } from "@/hooks/use-treasury-queries"; +import { useLockupPool } from "@/hooks/use-treasury-queries"; import { Proposal } from "@/lib/proposals-api"; import { useStakingFullAmount } from "../../hooks/use-staking-full-amount"; import { TitleSubtitleCell } from "./title-subtitle-cell"; -import { resolveUserDisplayName } from "@/components/user"; interface StakingCellProps { data: StakingData; @@ -33,13 +32,6 @@ export function StakingCell({ proposal, treasuryId, ); - const { data: profile } = useProfile(validator); - const address = validator - ? resolveUserDisplayName({ - accountId: validator, - profileName: profile?.name, - }) - : validator; const showAllLabel = data.isFullAmount && !resolvedAmount; @@ -49,7 +41,7 @@ export function StakingCell({ title={{t("allNear")}} subtitle={ validator - ? t("validatorSubtitle", { address: address ?? "" }) + ? t("validatorSubtitle", { address: validator }) : undefined } timestamp={timestamp} diff --git a/nt-fe/features/proposals/components/transaction-cell/token-cell.tsx b/nt-fe/features/proposals/components/transaction-cell/token-cell.tsx index 977da136..6a860116 100644 --- a/nt-fe/features/proposals/components/transaction-cell/token-cell.tsx +++ b/nt-fe/features/proposals/components/transaction-cell/token-cell.tsx @@ -6,9 +6,8 @@ import { StakingData, } from "../../types/index"; import { Amount } from "../amount"; -import { resolveUserDisplayName, TooltipUser } from "@/components/user"; +import { TooltipUser } from "@/components/user"; import { TitleSubtitleCell } from "./title-subtitle-cell"; -import { useProfile } from "@/hooks/use-treasury-queries"; import { useTreasury } from "@/hooks/use-treasury"; import { Tooltip } from "@/components/tooltip"; import { isNearComPaymentRoute } from "@/lib/intents-network"; @@ -38,6 +37,10 @@ export function TokenCell({ const destinationAssetId = "destinationAssetId" in data ? data.destinationAssetId : undefined; const isNearComDestination = isNearComPaymentRoute(destinationAssetId); + const displayReceiver = formatRecipientForNearComDestination( + data.receiver, + destinationAssetId, + ); const title = ( ); - const { data: profile } = useProfile(data.receiver); - const displayReceiver = formatRecipientForNearComDestination( - data.receiver, - destinationAssetId, - ); - const displayName = resolveUserDisplayName({ - accountId: data.receiver, - profileName: profile?.name, - }); - const nameIsAddress = - displayName.trim().toLowerCase() === data.receiver.trim().toLowerCase(); const showConfidentialAddressShield = isConfidential && isNearComDestination; @@ -81,23 +73,17 @@ export function TokenCell({ chainName={destinationAssetId} >
- {nameIsAddress ? ( -
- ) : ( - - {displayName} - - )} +
) : ( - {displayName} + {displayReceiver} )}