From ef7e99385d1c3477f56b44db744538f869545605 Mon Sep 17 00:00:00 2001 From: isstuev Date: Fri, 25 Oct 2024 12:17:38 +0200 Subject: [PATCH] couple more robust places --- types/api/address.ts | 26 +------------------ types/api/addressParams.ts | 25 +++++++++++++++++- ui/address/AddressDetails.tsx | 10 +++---- ui/address/filecoin/FilecoinActorTag.tsx | 2 +- ui/pages/Address.tsx | 1 - ui/shared/entities/address/AddressEntity.tsx | 2 +- .../address/AddressEntityContentProxy.tsx | 2 +- 7 files changed, 33 insertions(+), 35 deletions(-) diff --git a/types/api/address.ts b/types/api/address.ts index 9d316f81c3..c20b3eb034 100644 --- a/types/api/address.ts +++ b/types/api/address.ts @@ -1,6 +1,6 @@ import type { Transaction } from 'types/api/transaction'; -import type { UserTags, AddressImplementation, AddressParam } from './addressParams'; +import type { UserTags, AddressImplementation, AddressParam, AddressFilecoinParams } from './addressParams'; import type { Block, EpochRewardsType } from './block'; import type { InternalTransaction } from './internalTransaction'; import type { MudWorldSchema, MudWorldTable } from './mudWorlds'; @@ -270,27 +270,3 @@ export type AddressEpochRewardsItem = { epoch_number: number; associated_account: AddressParam; } - -export type AddressFilecoinParams = { - actor_type?: FilecoinActorType; - id?: string | null; - robust?: string | null; -} - -export type FilecoinActorType = - 'account' | - 'cron' | - 'datacap' | - 'eam' | - 'ethaccount' | - 'evm' | - 'init' | - 'market' | - 'miner' | - 'multisig' | - 'paych' | - 'placeholder' | - 'power' | - 'reward' | - 'system' | - 'verifreg'; diff --git a/types/api/addressParams.ts b/types/api/addressParams.ts index 4b82507154..1ccbd9273f 100644 --- a/types/api/addressParams.ts +++ b/types/api/addressParams.ts @@ -1,4 +1,3 @@ -import type { AddressFilecoinParams } from './address'; import type { AddressMetadataTagApi } from './addressMetadata'; export interface AddressImplementation { @@ -17,6 +16,30 @@ export interface WatchlistName { display_name: string; } +export type AddressFilecoinParams = { + actor_type?: FilecoinActorType; + id?: string | null; + robust?: string | null; +} + +export type FilecoinActorType = + 'account' | + 'cron' | + 'datacap' | + 'eam' | + 'ethaccount' | + 'evm' | + 'init' | + 'market' | + 'miner' | + 'multisig' | + 'paych' | + 'placeholder' | + 'power' | + 'reward' | + 'system' | + 'verifreg'; + export interface UserTags { private_tags: Array | null; watchlist_names: Array | null; diff --git a/ui/address/AddressDetails.tsx b/ui/address/AddressDetails.tsx index 5d56228eda..613f31e74c 100644 --- a/ui/address/AddressDetails.tsx +++ b/ui/address/AddressDetails.tsx @@ -17,7 +17,6 @@ import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem'; import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity'; -import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic'; import AddressBalance from './details/AddressBalance'; import AddressImplementations from './details/AddressImplementations'; @@ -134,10 +133,11 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => { Ethereum Address - - - - + ) } diff --git a/ui/address/filecoin/FilecoinActorTag.tsx b/ui/address/filecoin/FilecoinActorTag.tsx index 55db64fd8b..00af440848 100644 --- a/ui/address/filecoin/FilecoinActorTag.tsx +++ b/ui/address/filecoin/FilecoinActorTag.tsx @@ -1,7 +1,7 @@ import { Tag } from '@chakra-ui/react'; import React from 'react'; -import type { FilecoinActorType } from 'types/api/address'; +import type { FilecoinActorType } from 'types/api/addressParams'; const ACTOR_TYPES: Record = { account: 'Account', diff --git a/ui/pages/Address.tsx b/ui/pages/Address.tsx index dd55271750..6c87ecfd2b 100644 --- a/ui/pages/Address.tsx +++ b/ui/pages/Address.tsx @@ -349,7 +349,6 @@ const AddressPageContent = () => { address={{ ...addressQuery.data, hash: checkSummedHash, - filecoin: addressQuery.data?.filecoin, name: '', ens_domain_name: '', implementations: null, diff --git a/ui/shared/entities/address/AddressEntity.tsx b/ui/shared/entities/address/AddressEntity.tsx index e36eb5b0bf..422929e3f3 100644 --- a/ui/shared/entities/address/AddressEntity.tsx +++ b/ui/shared/entities/address/AddressEntity.tsx @@ -99,7 +99,7 @@ const Content = chakra((props: ContentProps) => { const label = ( { nameText } - { props.address.hash } + { props.address.filecoin?.robust ?? props.address.hash } ); diff --git a/ui/shared/entities/address/AddressEntityContentProxy.tsx b/ui/shared/entities/address/AddressEntityContentProxy.tsx index 66fbb4146f..73039f71cc 100644 --- a/ui/shared/entities/address/AddressEntityContentProxy.tsx +++ b/ui/shared/entities/address/AddressEntityContentProxy.tsx @@ -46,7 +46,7 @@ const AddressEntityContentProxy = (props: ContentProps) => { Proxy contract { props.address.name ? ` (${ props.address.name })` : '' } - + Implementation{ implementations.length > 1 ? 's' : '' } { implementationName ? ` (${ implementationName })` : '' }