Commit d297f0f0 authored by tom's avatar tom Committed by tom goriunov

add certified icon for tokens in search results

parent e2a076c1
...@@ -16,6 +16,7 @@ export interface SearchResultToken { ...@@ -16,6 +16,7 @@ export interface SearchResultToken {
is_verified_via_admin_panel: boolean; is_verified_via_admin_panel: boolean;
is_smart_contract_verified: boolean; is_smart_contract_verified: boolean;
filecoin_robust_address?: string | null; filecoin_robust_address?: string | null;
certified?: boolean;
} }
export interface SearchResultAddressOrContract { export interface SearchResultAddressOrContract {
......
...@@ -73,7 +73,8 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr ...@@ -73,7 +73,8 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr
textOverflow="ellipsis" textOverflow="ellipsis"
/> />
</LinkInternal> </LinkInternal>
{ data.is_verified_via_admin_panel && <IconSvg name="certified" boxSize={ 4 } ml={ 1 } color="green.500"/> } { data.certified && <ContractCertifiedLabel iconSize={ 4 } boxSize={ 4 } ml={ 1 }/> }
{ data.is_verified_via_admin_panel && !data.certified && <IconSvg name="certified" boxSize={ 4 } ml={ 1 } color="green.500"/> }
</Flex> </Flex>
); );
} }
...@@ -385,7 +386,7 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr ...@@ -385,7 +386,7 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr
<chakra.span color="text_secondary">{ expiresText }</chakra.span> <chakra.span color="text_secondary">{ expiresText }</chakra.span>
) } ) }
</Text> </Text>
{ data.certified && <ContractCertifiedLabel iconSize={ 5 } boxSize={ 5 } ml={ 1 }/> } { data.certified && <ContractCertifiedLabel iconSize={ 4 } boxSize={ 4 } ml={ 1 }/> }
</Flex> </Flex>
) : ) :
null; null;
......
...@@ -75,7 +75,8 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P ...@@ -75,7 +75,8 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P
dangerouslySetInnerHTML={{ __html: highlightText(name, searchTerm) }} dangerouslySetInnerHTML={{ __html: highlightText(name, searchTerm) }}
/> />
</LinkInternal> </LinkInternal>
{ data.is_verified_via_admin_panel && <IconSvg name="certified" boxSize={ 4 } ml={ 1 } color="green.500"/> } { data.certified && <ContractCertifiedLabel iconSize={ 4 } boxSize={ 4 } ml={ 1 }/> }
{ data.is_verified_via_admin_panel && !data.certified && <IconSvg name="certified" boxSize={ 4 } ml={ 1 } color="green.500"/> }
</Flex> </Flex>
</Td> </Td>
<Td fontSize="sm" verticalAlign="middle"> <Td fontSize="sm" verticalAlign="middle">
...@@ -154,7 +155,7 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P ...@@ -154,7 +155,7 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P
<chakra.span color="text_secondary">{ expiresText }</chakra.span> <chakra.span color="text_secondary">{ expiresText }</chakra.span>
) } ) }
</Text> </Text>
{ data.certified && <ContractCertifiedLabel iconSize={ 5 } boxSize={ 5 } mx={ 1 }/> } { data.certified && <ContractCertifiedLabel iconSize={ 4 } boxSize={ 4 } mx={ 1 }/> }
</Flex> </Flex>
</Td> </Td>
) } ) }
......
...@@ -46,7 +46,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm, addressFormat }: ...@@ -46,7 +46,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm, addressFormat }:
<span>{ expiresText }</span> <span>{ expiresText }</span>
) } ) }
</Text> </Text>
{ data.certified && <ContractCertifiedLabel boxSize={ 5 } iconSize={ 5 } ml={ 1 }/> } { data.certified && <ContractCertifiedLabel boxSize={ 4 } iconSize={ 4 } ml={ 1 }/> }
</Flex> </Flex>
); );
const addressEl = <HashStringShortenDynamic hash={ hash } isTooltipDisabled/>; const addressEl = <HashStringShortenDynamic hash={ hash } isTooltipDisabled/>;
......
...@@ -6,6 +6,7 @@ import type { SearchResultToken } from 'types/api/search'; ...@@ -6,6 +6,7 @@ import type { SearchResultToken } from 'types/api/search';
import { toBech32Address } from 'lib/address/bech32'; import { toBech32Address } from 'lib/address/bech32';
import highlightText from 'lib/highlightText'; import highlightText from 'lib/highlightText';
import ContractCertifiedLabel from 'ui/shared/ContractCertifiedLabel';
import * as TokenEntity from 'ui/shared/entities/token/TokenEntity'; import * as TokenEntity from 'ui/shared/entities/token/TokenEntity';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic'; import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
...@@ -13,6 +14,7 @@ import IconSvg from 'ui/shared/IconSvg'; ...@@ -13,6 +14,7 @@ import IconSvg from 'ui/shared/IconSvg';
const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: ItemsProps<SearchResultToken>) => { const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: ItemsProps<SearchResultToken>) => {
const icon = <TokenEntity.Icon token={{ ...data, type: data.token_type }}/>; const icon = <TokenEntity.Icon token={{ ...data, type: data.token_type }}/>;
const verifiedIcon = <IconSvg name="certified" boxSize={ 4 } color="green.500" ml={ 1 }/>; const verifiedIcon = <IconSvg name="certified" boxSize={ 4 } color="green.500" ml={ 1 }/>;
const certifiedIcon = <ContractCertifiedLabel iconSize={ 4 } boxSize={ 4 } ml={ 1 }/>;
const hash = data.filecoin_robust_address || (addressFormat === 'bech32' ? toBech32Address(data.address) : data.address); const hash = data.filecoin_robust_address || (addressFormat === 'bech32' ? toBech32Address(data.address) : data.address);
const name = ( const name = (
...@@ -49,7 +51,8 @@ const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: It ...@@ -49,7 +51,8 @@ const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: It
<Flex alignItems="center"> <Flex alignItems="center">
{ icon } { icon }
{ name } { name }
{ data.is_verified_via_admin_panel && verifiedIcon } { data.certified && certifiedIcon }
{ data.is_verified_via_admin_panel && !data.certified && verifiedIcon }
</Flex> </Flex>
<Grid templateColumns={ templateCols } alignItems="center" gap={ 2 }> <Grid templateColumns={ templateCols } alignItems="center" gap={ 2 }>
<Flex alignItems="center" overflow="hidden"> <Flex alignItems="center" overflow="hidden">
...@@ -67,7 +70,8 @@ const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: It ...@@ -67,7 +70,8 @@ const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: It
<Flex alignItems="center"> <Flex alignItems="center">
{ icon } { icon }
{ name } { name }
{ data.is_verified_via_admin_panel && verifiedIcon } { data.certified && certifiedIcon }
{ data.is_verified_via_admin_panel && !data.certified && verifiedIcon }
</Flex> </Flex>
<Flex alignItems="center" overflow="hidden"> <Flex alignItems="center" overflow="hidden">
{ address } { address }
......
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