Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Send/SendToken.js
import React, { useState, useEffect } from 'react'; | import React, { useState, useEffect } from 'react'; | ||||
import { Link } from 'react-router-dom'; | |||||
import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
import { WalletContext } from '@utils/context'; | import { WalletContext } from '@utils/context'; | ||||
import { | import { | ||||
Form, | Form, | ||||
message, | message, | ||||
Row, | Row, | ||||
Col, | Col, | ||||
Alert, | Alert, | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | const AntdDescriptionsCss = css` | ||||
.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}; | ||||
} | } | ||||
`; | `; | ||||
const AntdDescriptionsWrapper = styled.div` | const AntdDescriptionsWrapper = styled.div` | ||||
${AntdDescriptionsCss} | ${AntdDescriptionsCss} | ||||
`; | `; | ||||
const AirdropButton = styled.div` | |||||
text-align: center; | |||||
width: 100%; | |||||
padding: 10px; | |||||
border-radius: 5px; | |||||
background: ${props => props.theme.sentMessage}; | |||||
a { | |||||
color: ${props => props.theme.darkBlue}; | |||||
margin: 0; | |||||
font-size: 11px; | |||||
border: 1px solid ${props => props.theme.darkBlue}; | |||||
border-radius: 5px; | |||||
padding: 2px 10px; | |||||
opacity: 0.6; | |||||
} | |||||
a:hover { | |||||
opacity: 1; | |||||
border-color: ${props => props.theme.eCashBlue}; | |||||
color: ${props => props.theme.contrast}; | |||||
background: ${props => props.theme.eCashBlue}; | |||||
} | |||||
${({ received, ...props }) => | |||||
received && | |||||
` | |||||
text-align: left; | |||||
background: ${props.theme.receivedMessage}; | |||||
`} | |||||
`; | |||||
const SendToken = ({ tokenId, jestBCH, passLoadingStatus }) => { | const SendToken = ({ tokenId, jestBCH, passLoadingStatus }) => { | ||||
const { wallet, apiError, cashtabSettings } = | const { wallet, apiError, cashtabSettings } = | ||||
React.useContext(WalletContext); | React.useContext(WalletContext); | ||||
const walletState = getWalletState(wallet); | const walletState = getWalletState(wallet); | ||||
const { tokens, slpBalancesAndUtxos } = walletState; | const { tokens, slpBalancesAndUtxos } = walletState; | ||||
const token = tokens.find(token => token.tokenId === tokenId); | const token = tokens.find(token => token.tokenId === tokenId); | ||||
▲ Show 20 Lines • Show All 501 Lines • ▼ Show 20 Lines | return ( | ||||
tokenId={tokenId} | tokenId={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} | ||||
<br /> | |||||
<AirdropButton> | |||||
<Link | |||||
to={{ | |||||
pathname: `/airdrop`, | |||||
state: { | |||||
airdropEtokenId: | |||||
token.tokenId, | |||||
}, | |||||
}} | |||||
> | |||||
Airdrop XEC to holders | |||||
</Link> | |||||
</AirdropButton> | |||||
</Descriptions.Item> | </Descriptions.Item> | ||||
{tokenStats && ( | {tokenStats && ( | ||||
<> | <> | ||||
<Descriptions.Item label="Document URI"> | <Descriptions.Item label="Document URI"> | ||||
{tokenStats.documentUri} | {tokenStats.documentUri} | ||||
</Descriptions.Item> | </Descriptions.Item> | ||||
<Descriptions.Item label="Genesis Date"> | <Descriptions.Item label="Genesis Date"> | ||||
{tokenStats.timestampUnix !== | {tokenStats.timestampUnix !== | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |