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 { formatBalance, isValidStoredWallet } from '@utils/cashMethods'; | import { | ||||
formatBalance, | |||||
isValidStoredWallet, | |||||
fromSmallestDenomination, | |||||
} 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 { | import { | ||||
LoadingCtn, | LoadingCtn, | ||||
BalanceHeader, | BalanceHeader, | ||||
BalanceHeaderFiat, | BalanceHeaderFiat, | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | return ( | ||||
</p> | </p> | ||||
<CashLoader /> | <CashLoader /> | ||||
</> | </> | ||||
)} | )} | ||||
<CreateTokenForm | <CreateTokenForm | ||||
BCH={BCH} | BCH={BCH} | ||||
getRestUrl={getRestUrl} | getRestUrl={getRestUrl} | ||||
createToken={createToken} | createToken={createToken} | ||||
disabled={balances.totalBalanceInSatoshis < 546} | disabled={ | ||||
balances.totalBalanceInSatoshis < currency.dustSats | |||||
} | |||||
/> | /> | ||||
{balances.totalBalanceInSatoshis < 546 && ( | {balances.totalBalanceInSatoshis < currency.dustSats && ( | ||||
<AlertMsg> | <AlertMsg> | ||||
You need at least {currency.dust} {currency.ticker}{' '} | You need at least{' '} | ||||
($ | {fromSmallestDenomination( | ||||
{(currency.dust * fiatPrice).toFixed(4)} USD) to | currency.dustSats, | ||||
create a token | ).toString()}{' '} | ||||
{currency.ticker} ($ | |||||
{( | |||||
fromSmallestDenomination( | |||||
currency.dustSats, | |||||
).toString() * fiatPrice | |||||
).toFixed(4)}{' '} | |||||
USD) to create a token | |||||
</AlertMsg> | </AlertMsg> | ||||
)} | )} | ||||
{tokens && tokens.length > 0 ? ( | {tokens && tokens.length > 0 ? ( | ||||
<> | <> | ||||
<TokenList | <TokenList | ||||
wallet={wallet} | wallet={wallet} | ||||
tokens={tokens} | tokens={tokens} | ||||
Show All 13 Lines |