Commit baa20bff authored by isstuev's avatar isstuev

contract icon, temporary

parent 6fbf652a
...@@ -24,7 +24,7 @@ const CustomAbiListItem = ({ item, onEditClick, onDeleteClick }: Props) => { ...@@ -24,7 +24,7 @@ const CustomAbiListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return ( return (
<AccountListItemMobile> <AccountListItemMobile>
<AddressSnippet address={ item.contract_address_hash } subtitle={ item.name }/> <AddressSnippet address={ item.contract_address_hash } subtitle={ item.name } isContract/>
<TableItemActionButtons onDeleteClick={ onItemDeleteClick } onEditClick={ onItemEditClick }/> <TableItemActionButtons onDeleteClick={ onItemDeleteClick } onEditClick={ onItemEditClick }/>
</AccountListItemMobile> </AccountListItemMobile>
); );
......
...@@ -28,7 +28,7 @@ const CustomAbiTableItem = ({ item, onEditClick, onDeleteClick }: Props) => { ...@@ -28,7 +28,7 @@ const CustomAbiTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return ( return (
<Tr alignItems="top" key={ item.id }> <Tr alignItems="top" key={ item.id }>
<Td> <Td>
<AddressSnippet address={ item.contract_address_hash } subtitle={ item.name }/> <AddressSnippet address={ item.contract_address_hash } subtitle={ item.name } isContract/>
</Td> </Td>
<Td> <Td>
<TableItemActionButtons onDeleteClick={ onItemDeleteClick } onEditClick={ onItemEditClick }/> <TableItemActionButtons onDeleteClick={ onItemDeleteClick } onEditClick={ onItemEditClick }/>
......
...@@ -6,16 +6,20 @@ import AddressIcon from 'ui/shared/address/AddressIcon'; ...@@ -6,16 +6,20 @@ import AddressIcon from 'ui/shared/address/AddressIcon';
import AddressLink from 'ui/shared/address/AddressLink'; import AddressLink from 'ui/shared/address/AddressLink';
import CopyToClipboard from 'ui/shared/CopyToClipboard'; import CopyToClipboard from 'ui/shared/CopyToClipboard';
import AddressContractIcon from './address/AddressContractIcon';
interface Props { interface Props {
address: string; address: string;
subtitle?: string; subtitle?: string;
// temporary solution for custom abis while we don't have address info on account pages
isContract?: boolean;
} }
const AddressSnippet = ({ address, subtitle }: Props) => { const AddressSnippet = ({ address, isContract, subtitle }: Props) => {
return ( return (
<Box maxW="100%"> <Box maxW="100%">
<Address> <Address>
<AddressIcon hash={ address }/> { isContract ? <AddressContractIcon/> : <AddressIcon hash={ address }/> }
<AddressLink hash={ address } fontWeight="600" ml={ 2 }/> <AddressLink hash={ address } fontWeight="600" ml={ 2 }/>
<CopyToClipboard text={ address } ml={ 1 }/> <CopyToClipboard text={ address } ml={ 1 }/>
</Address> </Address>
......
import { Box, chakra, Tooltip } from '@chakra-ui/react';
import React from 'react';
type Props = {
className?: string;
}
const AddressContractIcon = ({ className }: Props) => {
return (
<Tooltip label="Contract">
<Box
className={ className }
width="24px"
height="24px"
borderRadius="12px"
backgroundColor="gray.200"
color="gray.400"
display="inline-flex"
alignItems="center"
justifyContent="center"
fontWeight="700"
>
С
</Box>
</Tooltip>
);
};
export default chakra(AddressContractIcon);
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