Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Common/BalanceHeaderFiat.js
import * as React from 'react'; | import * as React from 'react'; | ||||
import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
import { BalanceHeaderFiatWrap } from '@components/Common/Atoms'; | import { BalanceHeaderFiatWrap } from '@components/Common/Atoms'; | ||||
import { currency } from '@components/Common/Ticker.js'; | import { currency } from '@components/Common/Ticker.js'; | ||||
const BalanceHeaderFiat = ({ balance, settings, fiatPrice }) => { | const BalanceHeaderFiat = ({ balance, settings, fiatPrice }) => { | ||||
return ( | return ( | ||||
<BalanceHeaderFiatWrap> | <BalanceHeaderFiatWrap> | ||||
{settings | {settings | ||||
? `${currency.fiatCurrencies[settings.fiatCurrency].symbol} ` | ? `${currency.fiatCurrencies[settings.fiatCurrency].symbol}` | ||||
: '$ '} | : '$'} | ||||
{parseFloat((balance * fiatPrice).toFixed(2)).toLocaleString()}{' '} | {parseFloat((balance * fiatPrice).toFixed(2)).toLocaleString()}{' '} | ||||
{settings | {settings | ||||
? `${currency.fiatCurrencies[ | ? `${currency.fiatCurrencies[ | ||||
settings.fiatCurrency | settings.fiatCurrency | ||||
].slug.toUpperCase()} ` | ].slug.toUpperCase()} ` | ||||
: 'USD'} | : 'USD'} | ||||
</BalanceHeaderFiatWrap> | </BalanceHeaderFiatWrap> | ||||
); | ); | ||||
Show All 9 Lines |