Commit 6ba967d2 authored by tom's avatar tom

add cross links to lookup page

parent 4c3e6783
import { Button, chakra, Flex, Grid, Icon, Popover, PopoverBody, PopoverContent, PopoverTrigger, Skeleton, useDisclosure } from '@chakra-ui/react'; import { Button, chakra, Flex, Grid, Icon, Popover, PopoverBody, PopoverContent, PopoverTrigger, Skeleton, useDisclosure } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import { route } from 'nextjs-routes';
import config from 'configs/app'; import config from 'configs/app';
import arrowIcon from 'icons/arrows/east-mini.svg'; import arrowIcon from 'icons/arrows/east-mini.svg';
import ensIcon from 'icons/ENS_slim.svg'; import ensIcon from 'icons/ENS_slim.svg';
...@@ -98,8 +100,9 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => { ...@@ -98,8 +100,9 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
</div> </div>
) } ) }
{ (ownedDomains.length > 9 || resolvedDomains.length > 9) && ( { (ownedDomains.length > 9 || resolvedDomains.length > 9) && (
// TODO @tom2drum add href to link <LinkInternal
<LinkInternal> href={ route({ pathname: '/name-domains', query: { ownedBy: 'true', resolvedTo: 'true', q: addressHash } }) }
>
<span> More results</span> <span> More results</span>
<chakra.span color="text_secondary"> ({ data.totalRecords })</chakra.span> <chakra.span color="text_secondary"> ({ data.totalRecords })</chakra.span>
</LinkInternal> </LinkInternal>
......
...@@ -4,6 +4,8 @@ import React from 'react'; ...@@ -4,6 +4,8 @@ import React from 'react';
import type { EnsDomainDetailed } from 'types/api/ens'; import type { EnsDomainDetailed } from 'types/api/ens';
import { route } from 'nextjs-routes';
import clockIcon from 'icons/clock.svg'; import clockIcon from 'icons/clock.svg';
import iconSearch from 'icons/search.svg'; import iconSearch from 'icons/search.svg';
import type { ResourceError } from 'lib/api/resources'; import type { ResourceError } from 'lib/api/resources';
...@@ -68,9 +70,12 @@ const NameDomainDetails = ({ query }: Props) => { ...@@ -68,9 +70,12 @@ const NameDomainDetails = ({ query }: Props) => {
address={ query.data.registrant } address={ query.data.registrant }
isLoading={ isLoading } isLoading={ isLoading }
/> />
{ /* 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"
href={ route({ pathname: '/name-domains', query: { ownedBy: 'true', resolvedTo: 'true', q: query.data.registrant.hash } }) }
>
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/> <Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/>
</LinkInternal> </LinkInternal>
</Tooltip> </Tooltip>
...@@ -88,9 +93,12 @@ const NameDomainDetails = ({ query }: Props) => { ...@@ -88,9 +93,12 @@ const NameDomainDetails = ({ query }: Props) => {
address={ query.data.owner } address={ query.data.owner }
isLoading={ isLoading } isLoading={ isLoading }
/> />
{ /* 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"
href={ route({ pathname: '/name-domains', query: { ownedBy: 'true', resolvedTo: 'true', q: query.data.owner.hash } }) }
>
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/> <Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/>
</LinkInternal> </LinkInternal>
</Tooltip> </Tooltip>
......
...@@ -4,6 +4,8 @@ import React from 'react'; ...@@ -4,6 +4,8 @@ import React from 'react';
import type { RoutedTab } from 'ui/shared/Tabs/types'; import type { RoutedTab } from 'ui/shared/Tabs/types';
import { route } from 'nextjs-routes';
import config from 'configs/app'; import config from 'configs/app';
import iconSearch from 'icons/search.svg'; import iconSearch from 'icons/search.svg';
import useApiQuery from 'lib/api/useApiQuery'; import useApiQuery from 'lib/api/useApiQuery';
...@@ -64,12 +66,17 @@ const NameDomain = () => { ...@@ -64,12 +66,17 @@ const NameDomain = () => {
flexShrink={ 0 } flexShrink={ 0 }
/> />
) } ) }
{ /* TODO @tom2drum add correct href */ } { infoQuery.data?.resolvedAddress && (
<Tooltip label="Lookup for related domain names"> <Tooltip label="Lookup for related domain names">
<LinkInternal flexShrink={ 0 } display="inline-flex"> <LinkInternal
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/> flexShrink={ 0 }
</LinkInternal> display="inline-flex"
</Tooltip> href={ route({ pathname: '/name-domains', query: { ownedBy: 'true', resolvedTo: 'true', q: infoQuery.data?.resolvedAddress?.hash } }) }
>
<Icon as={ iconSearch } boxSize={ 5 } isLoading={ isLoading }/>
</LinkInternal>
</Tooltip>
) }
</Flex> </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