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 } from 'antd'; | import { Form, notification, message, Spin, Row, Col } from 'antd'; | ||||
import { CashSpin, CashSpinIcon } from '../Common/CustomSpinner'; | |||||
import { Row, Col } from 'antd'; | |||||
import Paragraph from 'antd/lib/typography/Paragraph'; | import Paragraph from 'antd/lib/typography/Paragraph'; | ||||
import PrimaryButton, { SecondaryButton } from '../Common/PrimaryButton'; | import PrimaryButton, { SecondaryButton } from '../Common/PrimaryButton'; | ||||
import { CashLoader } from '../Common/CustomIcons'; | import { CashLoader, CashLoadingIcon } from '../Common/CustomIcons'; | ||||
import { | import { | ||||
FormItemWithMaxAddon, | FormItemWithMaxAddon, | ||||
FormItemWithQRCodeAddon, | FormItemWithQRCodeAddon, | ||||
} from '../Common/EnhancedInputs'; | } from '../Common/EnhancedInputs'; | ||||
import useBCH from '../../hooks/useBCH'; | import useBCH from '../../hooks/useBCH'; | ||||
import { BalanceHeader } from './Send'; | import { BalanceHeader } from './Send'; | ||||
import { Redirect } from 'react-router-dom'; | import { Redirect } from 'react-router-dom'; | ||||
import useWindowDimensions from '../../hooks/useWindowDimensions'; | import useWindowDimensions from '../../hooks/useWindowDimensions'; | ||||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | return ( | ||||
<p>Available balance</p> | <p>Available balance</p> | ||||
<h3> | <h3> | ||||
{token.balance.toString()} {token.info.tokenTicker} | {token.balance.toString()} {token.info.tokenTicker} | ||||
</h3> | </h3> | ||||
</BalanceHeader> | </BalanceHeader> | ||||
<Row type="flex"> | <Row type="flex"> | ||||
<Col span={24}> | <Col span={24}> | ||||
<CashSpin | <Spin | ||||
style={{ color: 'red' }} | |||||
spinning={loading} | spinning={loading} | ||||
indicator={CashSpinIcon} | indicator={CashLoadingIcon} | ||||
> | > | ||||
<Form style={{ width: 'auto' }}> | <Form style={{ width: 'auto' }}> | ||||
<FormItemWithQRCodeAddon | <FormItemWithQRCodeAddon | ||||
loadWithCameraOpen={scannerSupported} | loadWithCameraOpen={scannerSupported} | ||||
validateStatus={ | validateStatus={ | ||||
!formData.dirty && !formData.address | !formData.dirty && !formData.address | ||||
? 'error' | ? 'error' | ||||
: '' | : '' | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | return ( | ||||
<p style={{ color: 'red' }}> | <p style={{ color: 'red' }}> | ||||
<b> | <b> | ||||
An error occured on our end. | An error occured on our end. | ||||
Reconnecting... | Reconnecting... | ||||
</b> | </b> | ||||
</p> | </p> | ||||
)} | )} | ||||
</Form> | </Form> | ||||
</CashSpin> | </Spin> | ||||
</Col> | </Col> | ||||
</Row> | </Row> | ||||
</> | </> | ||||
)} | )} | ||||
</> | </> | ||||
); | ); | ||||
}; | }; | ||||
export default SendToken; | export default SendToken; |