Commit 26e73db3 authored by tom's avatar tom

fix ts

parent 43feeff6
...@@ -41,7 +41,7 @@ const SearchResultListItem = ({ data, searchTerm }: Props) => { ...@@ -41,7 +41,7 @@ const SearchResultListItem = ({ data, searchTerm }: Props) => {
const shouldHighlightHash = data.address.toLowerCase() === searchTerm.toLowerCase(); const shouldHighlightHash = data.address.toLowerCase() === searchTerm.toLowerCase();
return ( return (
<Address> <Address>
<AddressIcon hash={ data.address } mr={ 2 } flexShrink={ 0 }/> <AddressIcon address={{ hash: data.address, is_contract: data.type === 'contract' }} mr={ 2 } flexShrink={ 0 }/>
<Box as={ shouldHighlightHash ? 'mark' : 'span' } display="block" whiteSpace="nowrap" overflow="hidden"> <Box as={ shouldHighlightHash ? 'mark' : 'span' } display="block" whiteSpace="nowrap" overflow="hidden">
<AddressLink hash={ data.address } fontWeight={ 700 } display="block" w="100%"/> <AddressLink hash={ data.address } fontWeight={ 700 } display="block" w="100%"/>
</Box> </Box>
......
...@@ -51,7 +51,7 @@ const SearchResultTableItem = ({ data, searchTerm }: Props) => { ...@@ -51,7 +51,7 @@ const SearchResultTableItem = ({ data, searchTerm }: Props) => {
<> <>
<Td fontSize="sm"> <Td fontSize="sm">
<Flex alignItems="center" overflow="hidden"> <Flex alignItems="center" overflow="hidden">
<AddressIcon hash={ data.address } mr={ 2 } flexShrink={ 0 }/> <AddressIcon address={{ hash: data.address, is_contract: data.type === 'contract' }} mr={ 2 } flexShrink={ 0 }/>
<Link href={ link('address_index', { id: data.address }) } fontWeight={ 700 } overflow="hidden" whiteSpace="nowrap"> <Link href={ link('address_index', { id: data.address }) } fontWeight={ 700 } overflow="hidden" whiteSpace="nowrap">
<Box as={ shouldHighlightHash ? 'mark' : 'span' } display="block"> <Box as={ shouldHighlightHash ? 'mark' : 'span' } display="block">
<HashStringShortenDynamic hash={ data.address }/> <HashStringShortenDynamic hash={ data.address }/>
...@@ -69,7 +69,7 @@ const SearchResultTableItem = ({ data, searchTerm }: Props) => { ...@@ -69,7 +69,7 @@ const SearchResultTableItem = ({ data, searchTerm }: Props) => {
return ( return (
<Td colSpan={ 2 } fontSize="sm"> <Td colSpan={ 2 } fontSize="sm">
<Address> <Address>
<AddressIcon hash={ data.address } mr={ 2 } flexShrink={ 0 }/> <AddressIcon address={{ hash: data.address, is_contract: data.type === 'contract' }} mr={ 2 } flexShrink={ 0 }/>
<mark> <mark>
<AddressLink hash={ data.address } type="address" fontWeight={ 700 }/> <AddressLink hash={ data.address } type="address" fontWeight={ 700 }/>
</mark> </mark>
......
...@@ -7,7 +7,7 @@ import type { AddressParam } from 'types/api/addressParams'; ...@@ -7,7 +7,7 @@ import type { AddressParam } from 'types/api/addressParams';
import AddressContractIcon from 'ui/shared/address/AddressContractIcon'; import AddressContractIcon from 'ui/shared/address/AddressContractIcon';
type Props = { type Props = {
address: AddressParam; address: Pick<AddressParam, 'is_contract' | 'hash'>;
className?: string; className?: string;
} }
......
...@@ -61,7 +61,7 @@ const SearchBarSuggestItem = ({ data, isMobile, searchTerm }: Props) => { ...@@ -61,7 +61,7 @@ const SearchBarSuggestItem = ({ data, isMobile, searchTerm }: Props) => {
const shouldHighlightHash = data.address.toLowerCase() === searchTerm.toLowerCase(); const shouldHighlightHash = data.address.toLowerCase() === searchTerm.toLowerCase();
return ( return (
<> <>
<AddressIcon hash={ data.address } mr={ 2 }/> <AddressIcon address={{ hash: data.address, is_contract: data.type === 'contract' }} mr={ 2 } flexShrink={ 0 }/>
<Box as={ shouldHighlightHash ? 'mark' : 'span' } display="block" overflow="hidden" whiteSpace="nowrap" fontWeight={ 700 }> <Box as={ shouldHighlightHash ? 'mark' : 'span' } display="block" overflow="hidden" whiteSpace="nowrap" fontWeight={ 700 }>
<HashStringShortenDynamic hash={ data.address } isTooltipDisabled/> <HashStringShortenDynamic hash={ data.address } isTooltipDisabled/>
</Box> </Box>
......
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