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 { Alert, Form, notification, message } from 'antd'; | import { Form, notification, message } from 'antd'; | ||||
import { CashSpin, CashSpinIcon } from '../Common/CustomSpinner'; | import { CashSpin, CashSpinIcon } from '../Common/CustomSpinner'; | ||||
import { Row, Col } from 'antd'; | import { Row, Col } from 'antd'; | ||||
import Paragraph from 'antd/lib/typography/Paragraph'; | import Paragraph from 'antd/lib/typography/Paragraph'; | ||||
import { SecondaryButton } from '../Common/PrimaryButton'; | import PrimaryButton, { SecondaryButton } from '../Common/PrimaryButton'; | ||||
import { CashLoader } from '../Common/CustomIcons'; | import { CashLoader } 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'; | ||||
▲ Show 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | return ( | ||||
{apiError || sendTokenAmountError ? ( | {apiError || sendTokenAmountError ? ( | ||||
<> | <> | ||||
<SecondaryButton> | <SecondaryButton> | ||||
Send {token.info.tokenName} | Send {token.info.tokenName} | ||||
</SecondaryButton> | </SecondaryButton> | ||||
{apiError && <CashLoader />} | {apiError && <CashLoader />} | ||||
</> | </> | ||||
) : ( | ) : ( | ||||
<SecondaryButton> | <PrimaryButton | ||||
onClick={() => submit()} | |||||
> | |||||
Send {token.info.tokenName} | Send {token.info.tokenName} | ||||
</SecondaryButton> | </PrimaryButton> | ||||
)} | )} | ||||
</div> | </div> | ||||
{apiError && ( | {apiError && ( | ||||
<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> | ||||
<Alert | |||||
message="Warning" | |||||
description="Sending SLPA tokens is currently disabled." | |||||
type="warning" | |||||
showIcon | |||||
closable | |||||
style={{ textAlign: 'left' }} | |||||
/> | |||||
</CashSpin> | </CashSpin> | ||||
</Col> | </Col> | ||||
</Row> | </Row> | ||||
</> | </> | ||||
)} | )} | ||||
</> | </> | ||||
); | ); | ||||
}; | }; | ||||
export default SendToken; | export default SendToken; |