Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Send/SendToken.js
Show All 22 Lines | |||||
import { getWalletState, toLegacyToken } from '@utils/cashMethods'; | import { getWalletState, toLegacyToken } from '@utils/cashMethods'; | ||||
import ApiError from '@components/Common/ApiError'; | import ApiError from '@components/Common/ApiError'; | ||||
import { | import { | ||||
sendTokenNotification, | sendTokenNotification, | ||||
errorNotification, | errorNotification, | ||||
} from '@components/Common/Notifications'; | } from '@components/Common/Notifications'; | ||||
import { isValidXecAddress, isValidEtokenAddress } from '@utils/validation'; | import { isValidXecAddress, isValidEtokenAddress } from '@utils/validation'; | ||||
import { formatDate } from '@utils/formatting'; | import { formatDate } from '@utils/formatting'; | ||||
import TokenIcon from '@components/Tokens/TokenIcon'; | |||||
import styled, { css } from 'styled-components'; | import styled, { css } from 'styled-components'; | ||||
const AntdDescriptionsCss = css` | const AntdDescriptionsCss = css` | ||||
.ant-descriptions-item-label, | .ant-descriptions-item-label, | ||||
.ant-descriptions-item-content { | .ant-descriptions-item-content { | ||||
background-color: ${props => props.theme.contrast} !important; | background-color: ${props => props.theme.contrast} !important; | ||||
color: ${props => props.theme.dropdownText}; | color: ${props => props.theme.dropdownText}; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | return ( | ||||
{tokenStats !== null && ( | {tokenStats !== null && ( | ||||
<AntdDescriptionsWrapper> | <AntdDescriptionsWrapper> | ||||
<Descriptions | <Descriptions | ||||
column={1} | column={1} | ||||
bordered | bordered | ||||
title={`Token info for "${token.info.tokenName}"`} | title={`Token info for "${token.info.tokenName}"`} | ||||
> | > | ||||
<Descriptions.Item label="Icon"> | <Descriptions.Item label="Icon"> | ||||
{currency.tokenIconsUrl !== '' ? ( | |||||
<Popover | <Popover | ||||
style={{ width: 256 }} | style={{ width: 256 }} | ||||
content={ | content={ | ||||
<Img | <TokenIcon | ||||
src={`${currency.tokenIconsUrl}/256/${tokenId}.png`} | size={256} | ||||
tokenId={tokenId} | |||||
/> | /> | ||||
} | } | ||||
trigger="click" | trigger="click" | ||||
color="transparent" | color="transparent" | ||||
> | > | ||||
<Img | <TokenIcon | ||||
src={`${currency.tokenIconsUrl}/32/${tokenId}.png`} | size={32} | ||||
width={32} | tokenId={tokenId} | ||||
height={32} | |||||
unloader={ | |||||
<img | |||||
alt={`identicon of tokenId ${tokenId} `} | |||||
height="32" | |||||
width="32" | |||||
style={{ | |||||
borderRadius: | |||||
'50%', | |||||
}} | |||||
key={`identicon-${tokenId}`} | |||||
src={makeBlockie( | |||||
tokenId, | |||||
)} | |||||
/> | |||||
} | |||||
/> | /> | ||||
</Popover> | </Popover> | ||||
) : ( | |||||
<img | |||||
alt={`identicon of tokenId ${tokenId} `} | |||||
height="32" | |||||
width="32" | |||||
style={{ | |||||
borderRadius: '50%', | |||||
}} | |||||
key={`identicon-${tokenId}`} | |||||
src={makeBlockie(tokenId)} | |||||
/> | |||||
)} | |||||
</Descriptions.Item> | </Descriptions.Item> | ||||
<Descriptions.Item label="Decimals"> | <Descriptions.Item label="Decimals"> | ||||
{token.info.decimals} | {token.info.decimals} | ||||
</Descriptions.Item> | </Descriptions.Item> | ||||
<Descriptions.Item label="Token ID"> | <Descriptions.Item label="Token ID"> | ||||
{token.tokenId} | {token.tokenId} | ||||
</Descriptions.Item> | </Descriptions.Item> | ||||
{tokenStats && ( | {tokenStats && ( | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |