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,29 +34,33 @@ const VerifiedAddressesListItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -34,29 +34,33 @@ 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>
<ListItemMobileGrid.Label>Token Info</ListItemMobileGrid.Label> { item.metadata.tokenName && (
<ListItemMobileGrid.Value py={ application ? '3px' : '5px' } display="flex" alignItems="center"> <>
{ application ? ( <ListItemMobileGrid.Label>Token Info</ListItemMobileGrid.Label>
<> <ListItemMobileGrid.Value py={ application ? '3px' : '5px' } display="flex" alignItems="center">
<VerifiedAddressesTokenSnippet application={ application }/> { application ? (
<Tooltip label="Edit"> <>
<IconButton <VerifiedAddressesTokenSnippet application={ application } name={ item.metadata.tokenName }/>
aria-label="edit" <Tooltip label="Edit">
variant="simple" <IconButton
boxSize={ 5 } aria-label="edit"
borderRadius="none" variant="simple"
flexShrink={ 0 } boxSize={ 5 }
onClick={ handleEditClick } borderRadius="none"
icon={ <Icon as={ editIcon }/> } flexShrink={ 0 }
/> onClick={ handleEditClick }
</Tooltip> icon={ <Icon as={ editIcon }/> }
</> />
) : ( </Tooltip>
<Link onClick={ handleAddClick }>Add details</Link> </>
) } ) : (
</ListItemMobileGrid.Value> <Link onClick={ handleAddClick }>Add details</Link>
) }
</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,33 +27,43 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props) ...@@ -27,33 +27,43 @@ 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 }/> </Td>
) : ( <Td>
<Link onClick={ handleAddClick }>Add details</Link> { item.metadata.tokenName && application ? (
) } <Tooltip label="Edit">
<IconButton
aria-label="edit"
variant="simple"
boxSize={ 5 }
borderRadius="none"
flexShrink={ 0 }
onClick={ handleEditClick }
icon={ <Icon as={ editIcon }/> }
/>
</Tooltip>
) : null }
</Td> </Td>
<Td>{ application ? ( <Td fontSize="sm"><VerifiedAddressesStatus status={ item.metadata.tokenName ? application?.status : undefined }/></Td>
<Tooltip label="Edit"> <Td fontSize="sm" color="text_secondary">{ item.metadata.tokenName ? dayjs(application?.updatedAt).format('MMM DD, YYYY') : null }</Td>
<IconButton
aria-label="edit"
variant="simple"
boxSize={ 5 }
borderRadius="none"
flexShrink={ 0 }
onClick={ handleEditClick }
icon={ <Icon as={ editIcon }/> }
/>
</Tooltip>
) : null }</Td>
<Td fontSize="sm"><VerifiedAddressesStatus status={ application?.status }/></Td>
<Td fontSize="sm" color="text_secondary">{ dayjs(application?.updatedAt).format('MMM DD, YYYY') }</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