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 { WalletContext } from '@utils/context'; | import { WalletContext } from '@utils/context'; | ||||
import { Form, notification, message, Spin, Row, Col, Alert } from 'antd'; | import { Form, notification, message, Spin, Row, Col, Alert } from 'antd'; | ||||
import Paragraph from 'antd/lib/typography/Paragraph'; | import Paragraph from 'antd/lib/typography/Paragraph'; | ||||
import PrimaryButton, { | import PrimaryButton, { | ||||
SecondaryButton, | SecondaryButton, | ||||
} from '@components/Common/PrimaryButton'; | } from '@components/Common/PrimaryButton'; | ||||
import { CashLoader, CashLoadingIcon } from '@components/Common/CustomIcons'; | import { CashLoader, CashLoadingIcon } from '@components/Common/CustomIcons'; | ||||
import { | import { | ||||
FormItemWithMaxAddon, | FormItemWithMaxAddon, | ||||
FormItemWithQRCodeAddon, | FormItemWithQRCodeAddon, | ||||
} from '@components/Common/EnhancedInputs'; | } from '@components/Common/EnhancedInputs'; | ||||
import useBCH from '@hooks/useBCH'; | import useBCH from '@hooks/useBCH'; | ||||
import { BalanceHeader } from './Send'; | import { BalanceHeader } from '@components/Common/Atoms'; | ||||
import { Redirect } from 'react-router-dom'; | import { Redirect } from 'react-router-dom'; | ||||
import useWindowDimensions from '@hooks/useWindowDimensions'; | import useWindowDimensions from '@hooks/useWindowDimensions'; | ||||
import { isMobile, isIOS, isSafari } from 'react-device-detect'; | import { isMobile, isIOS, isSafari } from 'react-device-detect'; | ||||
import { Img } from 'react-image'; | import { Img } from 'react-image'; | ||||
import makeBlockie from 'ethereum-blockies-base64'; | import makeBlockie from 'ethereum-blockies-base64'; | ||||
import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||
import { | import { | ||||
currency, | currency, | ||||
▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | const SendToken = ({ tokenId, jestBCH }) => { | ||||
return ( | return ( | ||||
<> | <> | ||||
{!token && <Redirect to="/" />} | {!token && <Redirect to="/" />} | ||||
{token && ( | {token && ( | ||||
<> | <> | ||||
<BalanceHeader> | <BalanceHeader> | ||||
<p>Available balance</p> | {formatBalance(token.balance)} {token.info.tokenTicker} | ||||
<h3> | |||||
{formatBalance(token.balance)}{' '} | |||||
{token.info.tokenTicker} | |||||
</h3> | |||||
</BalanceHeader> | </BalanceHeader> | ||||
<Row type="flex"> | <Row type="flex"> | ||||
<Col span={24}> | <Col span={24}> | ||||
<Spin | <Spin | ||||
style={{ | style={{ | ||||
color: 'red', | color: 'red', | ||||
}} | }} | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |