Commit 5d19b2a1 authored by tom's avatar tom

manage incomplete data

parent 85f1bcb4
...@@ -38,6 +38,8 @@ export const PAGE_TYPE_DICT: Record<Route['pathname'], string> = { ...@@ -38,6 +38,8 @@ export const PAGE_TYPE_DICT: Record<Route['pathname'], string> = {
'/zkevm-l2-txn-batches': 'ZkEvm L2 Tx batches', '/zkevm-l2-txn-batches': 'ZkEvm L2 Tx batches',
'/zkevm-l2-txn-batch/[number]': 'ZkEvm L2 Tx batch details', '/zkevm-l2-txn-batch/[number]': 'ZkEvm L2 Tx batch details',
'/404': '404', '/404': '404',
'/name-domains': 'Domains search and resolve',
'/name-domains/[name]': 'Domain details',
// service routes, added only to make typescript happy // service routes, added only to make typescript happy
'/login': 'Login', '/login': 'Login',
......
...@@ -3,10 +3,10 @@ export interface EnsDomain { ...@@ -3,10 +3,10 @@ export interface EnsDomain {
name: string; name: string;
resolvedAddress: { resolvedAddress: {
hash: string; hash: string;
}; } | null;
owner: { owner: {
hash: string; hash: string;
}; } | null;
registrationDate?: string; registrationDate?: string;
expiryDate?: string; expiryDate?: string;
} }
...@@ -15,7 +15,7 @@ export interface EnsDomainDetailed extends EnsDomain { ...@@ -15,7 +15,7 @@ export interface EnsDomainDetailed extends EnsDomain {
tokenId: string; tokenId: string;
registrant: { registrant: {
hash: string; hash: string;
}; } | null;
otherAddresses: Record<string, string>; otherAddresses: Record<string, string>;
} }
...@@ -24,7 +24,7 @@ export interface EnsDomainEvent { ...@@ -24,7 +24,7 @@ export interface EnsDomainEvent {
timestamp: string; timestamp: string;
fromAddress: { fromAddress: {
hash: string; hash: string;
}; } | null;
action?: string; action?: string;
} }
......
...@@ -40,10 +40,12 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => { ...@@ -40,10 +40,12 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
const mainDomain = data.items.find((domain) => domain.name === mainDomainName); const mainDomain = data.items.find((domain) => domain.name === mainDomainName);
const ownedDomains = data.items.filter((domain) => const ownedDomains = data.items.filter((domain) =>
domain.owner &&
domain.owner.hash.toLowerCase() === addressHash.toLowerCase() && domain.owner.hash.toLowerCase() === addressHash.toLowerCase() &&
domain.name !== mainDomainName, domain.name !== mainDomainName,
); );
const resolvedDomains = data.items.filter((domain) => const resolvedDomains = data.items.filter((domain) =>
domain.resolvedAddress &&
domain.resolvedAddress.hash.toLowerCase() === addressHash.toLowerCase() && domain.resolvedAddress.hash.toLowerCase() === addressHash.toLowerCase() &&
domain.name !== mainDomainName, domain.name !== mainDomainName,
); );
......
...@@ -71,42 +71,46 @@ const NameDomainDetails = ({ query }: Props) => { ...@@ -71,42 +71,46 @@ const NameDomainDetails = ({ query }: Props) => {
</Skeleton> </Skeleton>
</DetailsInfoItem> </DetailsInfoItem>
) } ) }
<DetailsInfoItem { query.data?.registrant && (
title="Registrant" <DetailsInfoItem
hint="The account that owns the domain name and has the rights to edit its ownership and records" title="Registrant"
isLoading={ isLoading } hint="The account that owns the domain name and has the rights to edit its ownership and records"
columnGap={ 2 }
flexWrap="nowrap"
>
<AddressEntity
address={ query.data?.registrant }
isLoading={ isLoading } isLoading={ isLoading }
/> columnGap={ 2 }
{ /* TODO @tom2drum add correct href */ } flexWrap="nowrap"
<Tooltip label="Lookup for related domain names"> >
<LinkInternal flexShrink={ 0 } display="inline-flex"> <AddressEntity
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/> address={ query.data.registrant }
</LinkInternal> isLoading={ isLoading }
</Tooltip> />
</DetailsInfoItem> { /* TODO @tom2drum add correct href */ }
<DetailsInfoItem <Tooltip label="Lookup for related domain names">
title="Controller" <LinkInternal flexShrink={ 0 } display="inline-flex">
hint="The account that owns the rights to edit the records of this domain name" <Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/>
isLoading={ isLoading } </LinkInternal>
columnGap={ 2 } </Tooltip>
flexWrap="nowrap" </DetailsInfoItem>
> ) }
<AddressEntity { query.data?.owner && (
address={ query.data?.owner } <DetailsInfoItem
title="Controller"
hint="The account that owns the rights to edit the records of this domain name"
isLoading={ isLoading } isLoading={ isLoading }
/> columnGap={ 2 }
{ /* TODO @tom2drum add correct href */ } flexWrap="nowrap"
<Tooltip label="Lookup for related domain names"> >
<LinkInternal flexShrink={ 0 } display="inline-flex"> <AddressEntity
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/> address={ query.data.owner }
</LinkInternal> isLoading={ isLoading }
</Tooltip> />
</DetailsInfoItem> { /* TODO @tom2drum add correct href */ }
<Tooltip label="Lookup for related domain names">
<LinkInternal flexShrink={ 0 } display="inline-flex">
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/>
</LinkInternal>
</Tooltip>
</DetailsInfoItem>
) }
<DetailsInfoItem <DetailsInfoItem
title="Token ID" title="Token ID"
hint="The Token ID of this domain name NFT" hint="The Token ID of this domain name NFT"
......
...@@ -14,7 +14,6 @@ import NameDomainDetails from 'ui/nameDomain/NameDomainDetails'; ...@@ -14,7 +14,6 @@ import NameDomainDetails from 'ui/nameDomain/NameDomainDetails';
import NameDomainHistory from 'ui/nameDomain/NameDomainHistory'; import NameDomainHistory from 'ui/nameDomain/NameDomainHistory';
import TextAd from 'ui/shared/ad/TextAd'; import TextAd from 'ui/shared/ad/TextAd';
import Icon from 'ui/shared/chakra/Icon'; import Icon from 'ui/shared/chakra/Icon';
import DataFetchAlert from 'ui/shared/DataFetchAlert';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import EnsEntity from 'ui/shared/entities/ens/EnsEntity'; import EnsEntity from 'ui/shared/entities/ens/EnsEntity';
import LinkInternal from 'ui/shared/LinkInternal'; import LinkInternal from 'ui/shared/LinkInternal';
...@@ -43,7 +42,7 @@ const NameDomain = () => { ...@@ -43,7 +42,7 @@ const NameDomain = () => {
const tabIndex = useTabIndexFromQuery(tabs); const tabIndex = useTabIndexFromQuery(tabs);
if (infoQuery.isError) { if (infoQuery.isError) {
return <DataFetchAlert/>; throw new Error(undefined, { cause: infoQuery.error });
} }
const isLoading = infoQuery.isPlaceholderData; const isLoading = infoQuery.isPlaceholderData;
...@@ -56,13 +55,15 @@ const NameDomain = () => { ...@@ -56,13 +55,15 @@ const NameDomain = () => {
noLink noLink
maxW="300px" maxW="300px"
/> />
<AddressEntity { infoQuery.data?.resolvedAddress && (
address={ infoQuery.data?.resolvedAddress } <AddressEntity
isLoading={ isLoading } address={ infoQuery.data?.resolvedAddress }
truncation={ isMobile ? 'constant' : 'dynamic' } isLoading={ isLoading }
noLink truncation={ isMobile ? 'constant' : 'dynamic' }
flexShrink={ 0 } noLink
/> flexShrink={ 0 }
/>
) }
{ /* TODO @tom2drum add correct href */ } { /* TODO @tom2drum add correct href */ }
<Tooltip label="Lookup for related domain names"> <Tooltip label="Lookup for related domain names">
<LinkInternal flexShrink={ 0 } display="inline-flex"> <LinkInternal flexShrink={ 0 } display="inline-flex">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment