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 React from 'react';
import { route } from 'nextjs-routes';
import config from 'configs/app';
import arrowIcon from 'icons/arrows/east-mini.svg';
import ensIcon from 'icons/ENS_slim.svg';
......@@ -98,8 +100,9 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
</div>
) }
{ (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>
<chakra.span color="text_secondary"> ({ data.totalRecords })</chakra.span>
</LinkInternal>
......
......@@ -4,6 +4,8 @@ import React from 'react';
import type { EnsDomainDetailed } from 'types/api/ens';
import { route } from 'nextjs-routes';
import clockIcon from 'icons/clock.svg';
import iconSearch from 'icons/search.svg';
import type { ResourceError } from 'lib/api/resources';
......@@ -68,9 +70,12 @@ const NameDomainDetails = ({ query }: Props) => {
address={ query.data.registrant }
isLoading={ isLoading }
/>
{ /* TODO @tom2drum add correct href */ }
<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 }/>
</LinkInternal>
</Tooltip>
......@@ -88,9 +93,12 @@ const NameDomainDetails = ({ query }: Props) => {
address={ query.data.owner }
isLoading={ isLoading }
/>
{ /* TODO @tom2drum add correct href */ }
<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 }/>
</LinkInternal>
</Tooltip>
......
......@@ -4,6 +4,8 @@ import React from 'react';
import type { RoutedTab } from 'ui/shared/Tabs/types';
import { route } from 'nextjs-routes';
import config from 'configs/app';
import iconSearch from 'icons/search.svg';
import useApiQuery from 'lib/api/useApiQuery';
......@@ -64,12 +66,17 @@ const NameDomain = () => {
flexShrink={ 0 }
/>
) }
{ /* 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>
{ infoQuery.data?.resolvedAddress && (
<Tooltip label="Lookup for related domain names">
<LinkInternal
flexShrink={ 0 }
display="inline-flex"
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>
);
......
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