Commit 23fb109d authored by tom's avatar tom

token name in account view

parent 8b087e48
...@@ -166,6 +166,10 @@ export interface VerifiedAddress { ...@@ -166,6 +166,10 @@ export interface VerifiedAddress {
chainId: string; chainId: string;
contractAddress: string; contractAddress: string;
verifiedDate: string; verifiedDate: string;
metadata: {
tokenName: string | null;
tokenSymbol: string | null;
};
} }
export interface VerifiedAddressResponse { export interface VerifiedAddressResponse {
......
...@@ -34,11 +34,13 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -34,11 +34,13 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props)
<AddressSnippet address={{ hash: item.contractAddress, is_contract: true, implementation_name: null }}/> <AddressSnippet address={{ hash: item.contractAddress, is_contract: true, implementation_name: null }}/>
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
{ item.metadata.tokenName && (
<>
<ListItemMobileGrid.Label>Token Info</ListItemMobileGrid.Label> <ListItemMobileGrid.Label>Token Info</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value py={ application ? '3px' : '5px' } display="flex" alignItems="center"> <ListItemMobileGrid.Value py={ application ? '3px' : '5px' } display="flex" alignItems="center">
{ application ? ( { application ? (
<> <>
<VerifiedAddressesTokenSnippet application={ application }/> <VerifiedAddressesTokenSnippet application={ application } name={ item.metadata.tokenName }/>
<Tooltip label="Edit"> <Tooltip label="Edit">
<IconButton <IconButton
aria-label="edit" aria-label="edit"
...@@ -55,8 +57,10 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -55,8 +57,10 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props)
<Link onClick={ handleAddClick }>Add details</Link> <Link onClick={ handleAddClick }>Add details</Link>
) } ) }
</ListItemMobileGrid.Value> </ListItemMobileGrid.Value>
</>
) }
{ application && ( { item.metadata.tokenName && application && (
<> <>
<ListItemMobileGrid.Label>Status</ListItemMobileGrid.Label> <ListItemMobileGrid.Label>Status</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
...@@ -65,7 +69,7 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -65,7 +69,7 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props)
</> </>
) } ) }
{ application && ( { item.metadata.tokenName && application && (
<> <>
<ListItemMobileGrid.Label>Date</ListItemMobileGrid.Label> <ListItemMobileGrid.Label>Date</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
......
...@@ -27,19 +27,28 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -27,19 +27,28 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props)
onEdit(item.contractAddress); onEdit(item.contractAddress);
}, [ item, onEdit ]); }, [ item, onEdit ]);
const tokenInfo = (() => {
if (!item.metadata.tokenName) {
return <span>Not a token</span>;
}
if (!application) {
return <Link onClick={ handleAddClick }>Add details</Link>;
}
return <VerifiedAddressesTokenSnippet application={ application } name={ item.metadata.tokenName }/>;
})();
return ( return (
<Tr> <Tr>
<Td> <Td>
<AddressSnippet address={{ hash: item.contractAddress, is_contract: true, implementation_name: null }}/> <AddressSnippet address={{ hash: item.contractAddress, is_contract: true, implementation_name: null }}/>
</Td> </Td>
<Td fontSize="sm" verticalAlign="middle"> <Td fontSize="sm" verticalAlign="middle">
{ application ? ( { tokenInfo }
<VerifiedAddressesTokenSnippet application={ application }/>
) : (
<Link onClick={ handleAddClick }>Add details</Link>
) }
</Td> </Td>
<Td>{ application ? ( <Td>
{ item.metadata.tokenName && application ? (
<Tooltip label="Edit"> <Tooltip label="Edit">
<IconButton <IconButton
aria-label="edit" aria-label="edit"
...@@ -51,9 +60,10 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -51,9 +60,10 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props)
icon={ <Icon as={ editIcon }/> } icon={ <Icon as={ editIcon }/> }
/> />
</Tooltip> </Tooltip>
) : null }</Td> ) : null }
<Td fontSize="sm"><VerifiedAddressesStatus status={ application?.status }/></Td> </Td>
<Td fontSize="sm" color="text_secondary">{ dayjs(application?.updatedAt).format('MMM DD, YYYY') }</Td> <Td fontSize="sm"><VerifiedAddressesStatus status={ item.metadata.tokenName ? application?.status : undefined }/></Td>
<Td fontSize="sm" color="text_secondary">{ item.metadata.tokenName ? dayjs(application?.updatedAt).format('MMM DD, YYYY') : null }</Td>
</Tr> </Tr>
); );
}; };
......
...@@ -8,9 +8,10 @@ import TokenLogoPlaceholder from 'ui/shared/TokenLogoPlaceholder'; ...@@ -8,9 +8,10 @@ import TokenLogoPlaceholder from 'ui/shared/TokenLogoPlaceholder';
interface Props { interface Props {
application: TokenInfoApplication; application: TokenInfoApplication;
name: string;
} }
const VerifiedAddressesTokenSnippet = ({ application }: Props) => { const VerifiedAddressesTokenSnippet = ({ application, name }: Props) => {
return ( return (
<Flex alignItems="center" columnGap={ 2 } w="100%"> <Flex alignItems="center" columnGap={ 2 } w="100%">
<Image <Image
...@@ -23,7 +24,7 @@ const VerifiedAddressesTokenSnippet = ({ application }: Props) => { ...@@ -23,7 +24,7 @@ const VerifiedAddressesTokenSnippet = ({ application }: Props) => {
/> />
<AddressLink <AddressLink
hash={ application.tokenAddress } hash={ application.tokenAddress }
alias={ application.projectName } alias={ name }
type="token" type="token"
isDisabled={ application.status === 'IN_PROCESS' } isDisabled={ application.status === 'IN_PROCESS' }
fontWeight={ 500 } fontWeight={ 500 }
......
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