Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Send/Send.js
Show All 17 Lines | |||||
import { | 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 { formatBalance } from '@utils/cashMethods'; | |||||
export const BalanceHeader = styled.div` | export const BalanceHeader = styled.div` | ||||
p { | p { | ||||
color: #777; | color: #777; | ||||
width: 100%; | width: 100%; | ||||
font-size: 14px; | font-size: 14px; | ||||
margin-bottom: 0px; | margin-bottom: 0px; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | return ( | ||||
<br /> | <br /> | ||||
Deposit some funds to use this feature | Deposit some funds to use this feature | ||||
</ZeroBalanceHeader> | </ZeroBalanceHeader> | ||||
) : ( | ) : ( | ||||
<> | <> | ||||
<BalanceHeader> | <BalanceHeader> | ||||
<p>Available balance</p> | <p>Available balance</p> | ||||
<h3> | <h3> | ||||
{balances.totalBalance} {currency.ticker} | {formatBalance(balances.totalBalance)}{' '} | ||||
{currency.ticker} | |||||
</h3> | </h3> | ||||
</BalanceHeader> | </BalanceHeader> | ||||
{fiatPrice !== null && ( | {fiatPrice !== null && ( | ||||
<BalanceHeaderFiat> | <BalanceHeaderFiat> | ||||
${(balances.totalBalance * fiatPrice).toFixed(2)}{' '} | ${(balances.totalBalance * fiatPrice).toFixed(2)}{' '} | ||||
USD | USD | ||||
</BalanceHeaderFiat> | </BalanceHeaderFiat> | ||||
)} | )} | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |