Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Send/Send.js
| Show All 17 Lines | import { | ||||
| currency, | currency, | ||||
| isValidTokenPrefix, | isValidTokenPrefix, | ||||
| parseAddress, | parseAddress, | ||||
| toLegacy, | toLegacy, | ||||
| } from '@components/Common/Ticker.js'; | } from '@components/Common/Ticker.js'; | ||||
| import { Event } from '@utils/GoogleAnalytics'; | import { Event } from '@utils/GoogleAnalytics'; | ||||
| import { fiatToCrypto, shouldRejectAmountInput } from '@utils/validation'; | import { fiatToCrypto, shouldRejectAmountInput } from '@utils/validation'; | ||||
| import { BalanceHeader } from '@components/Common/BalanceHeader'; | import { BalanceHeader } from '@components/Common/BalanceHeader'; | ||||
| import { BalanceHeaderFiat } from '@components/Common/BalanceHeaderFiat'; | |||||
| import { | import { | ||||
| BalanceHeaderFiat, | |||||
| ZeroBalanceHeader, | ZeroBalanceHeader, | ||||
| ConvertAmount, | ConvertAmount, | ||||
| AlertMsg, | AlertMsg, | ||||
| } from '@components/Common/Atoms'; | } from '@components/Common/Atoms'; | ||||
| // Note jestBCH is only used for unit tests; BCHJS must be mocked for jest | // Note jestBCH is only used for unit tests; BCHJS must be mocked for jest | ||||
| const SendBCH = ({ jestBCH, filledAddress, callbackTxId }) => { | const SendBCH = ({ jestBCH, filledAddress, callbackTxId }) => { | ||||
| // use balance parameters from wallet.state object and not legacy balances parameter from walletState, if user has migrated wallet | // use balance parameters from wallet.state object and not legacy balances parameter from walletState, if user has migrated wallet | ||||
| ▲ Show 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | return ( | ||||
| </ZeroBalanceHeader> | </ZeroBalanceHeader> | ||||
| ) : ( | ) : ( | ||||
| <> | <> | ||||
| <BalanceHeader | <BalanceHeader | ||||
| balance={balances.totalBalance} | balance={balances.totalBalance} | ||||
| ticker={currency.ticker} | ticker={currency.ticker} | ||||
| ></BalanceHeader> | ></BalanceHeader> | ||||
| {fiatPrice !== null && ( | {fiatPrice !== null && ( | ||||
| <BalanceHeaderFiat> | <BalanceHeaderFiat | ||||
| {cashtabSettings | balance={balances.totalBalance} | ||||
| ? `${ | settings={cashtabSettings} | ||||
| currency.fiatCurrencies[ | fiatPrice={fiatPrice} | ||||
| cashtabSettings.fiatCurrency | /> | ||||
| ].symbol | |||||
| } ` | |||||
| : '$ '} | |||||
| {(balances.totalBalance * fiatPrice).toFixed(2)}{' '} | |||||
| {cashtabSettings | |||||
| ? `${currency.fiatCurrencies[ | |||||
| cashtabSettings.fiatCurrency | |||||
| ].slug.toUpperCase()} ` | |||||
| : 'USD'} | |||||
| </BalanceHeaderFiat> | |||||
| )} | )} | ||||
| </> | </> | ||||
| )} | )} | ||||
| <Row type="flex"> | <Row type="flex"> | ||||
| <Col span={24}> | <Col span={24}> | ||||
| <Spin spinning={loading} indicator={CashLoadingIcon}> | <Spin spinning={loading} indicator={CashLoadingIcon}> | ||||
| <Form | <Form | ||||
| ▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines | |||||