Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Tokens/Tokens.js
| import React from 'react'; | import React from 'react'; | ||||
| import { LoadingOutlined } from '@ant-design/icons'; | import { LoadingOutlined } from '@ant-design/icons'; | ||||
| import { CashLoader } from '@components/Common/CustomIcons'; | import { CashLoader } from '@components/Common/CustomIcons'; | ||||
| import { WalletContext } from '@utils/context'; | import { WalletContext } from '@utils/context'; | ||||
| import { | import { | ||||
| isValidStoredWallet, | isValidStoredWallet, | ||||
| fromSmallestDenomination, | fromSmallestDenomination, | ||||
| } from '@utils/cashMethods'; | } from '@utils/cashMethods'; | ||||
| import CreateTokenForm from '@components/Tokens/CreateTokenForm'; | import CreateTokenForm from '@components/Tokens/CreateTokenForm'; | ||||
| import { currency } from '@components/Common/Ticker.js'; | import { currency } from '@components/Common/Ticker.js'; | ||||
| import TokenList from '@components/Wallet/TokenList'; | import TokenList from '@components/Wallet/TokenList'; | ||||
| import useBCH from '@hooks/useBCH'; | import useBCH from '@hooks/useBCH'; | ||||
| import { BalanceHeader } from '@components/Common/BalanceHeader'; | import { BalanceHeader } from '@components/Common/BalanceHeader'; | ||||
| import { BalanceHeaderFiat } from '@components/Common/BalanceHeaderFiat'; | |||||
| import { | import { | ||||
| LoadingCtn, | LoadingCtn, | ||||
| BalanceHeaderFiat, | |||||
| ZeroBalanceHeader, | ZeroBalanceHeader, | ||||
| AlertMsg, | AlertMsg, | ||||
| } from '@components/Common/Atoms'; | } from '@components/Common/Atoms'; | ||||
| const Tokens = ({ jestBCH }) => { | const Tokens = ({ jestBCH }) => { | ||||
| /* | /* | ||||
| Dev note | Dev note | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | return ( | ||||
| ) : ( | ) : ( | ||||
| <> | <> | ||||
| <BalanceHeader | <BalanceHeader | ||||
| balance={balances.totalBalance} | balance={balances.totalBalance} | ||||
| ticker={currency.ticker} | ticker={currency.ticker} | ||||
| ></BalanceHeader> | ></BalanceHeader> | ||||
| {fiatPrice !== null && | {fiatPrice !== null && | ||||
| !isNaN(balances.totalBalance) && ( | !isNaN(balances.totalBalance) && ( | ||||
| <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> | |||||
| )} | )} | ||||
| </> | </> | ||||
| )} | )} | ||||
| {apiError && ( | {apiError && ( | ||||
| <> | <> | ||||
| <p | <p | ||||
| style={{ | style={{ | ||||
| color: 'red', | color: 'red', | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||