Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Tokens/Tokens.js
import React from 'react'; | import React from 'react'; | ||||
import { CashLoader } from '@components/Common/CustomIcons'; | |||||
import { WalletContext } from '@utils/context'; | import { WalletContext } from '@utils/context'; | ||||
import { fromSmallestDenomination, getWalletState } from '@utils/cashMethods'; | import { fromSmallestDenomination, getWalletState } 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 { BalanceHeaderFiat } from '@components/Common/BalanceHeaderFiat'; | ||||
import { ZeroBalanceHeader, AlertMsg } from '@components/Common/Atoms'; | import { ZeroBalanceHeader, AlertMsg } from '@components/Common/Atoms'; | ||||
import { ApiError } from '@components/Common/ApiError'; | |||||
const Tokens = ({ jestBCH, passLoadingStatus }) => { | const Tokens = ({ jestBCH, passLoadingStatus }) => { | ||||
/* | /* | ||||
Dev note | Dev note | ||||
This is the first new page created after the wallet migration to include state in storage | This is the first new page created after the wallet migration to include state in storage | ||||
As such, it will only load this type of wallet | As such, it will only load this type of wallet | ||||
Show All 35 Lines | return ( | ||||
<BalanceHeaderFiat | <BalanceHeaderFiat | ||||
balance={balances.totalBalance} | balance={balances.totalBalance} | ||||
settings={cashtabSettings} | settings={cashtabSettings} | ||||
fiatPrice={fiatPrice} | fiatPrice={fiatPrice} | ||||
/> | /> | ||||
)} | )} | ||||
</> | </> | ||||
)} | )} | ||||
{apiError && ( | {apiError && <ApiError />} | ||||
<> | |||||
<p | |||||
style={{ | |||||
color: 'red', | |||||
}} | |||||
> | |||||
<b>An error occurred on our end.</b> | |||||
<br></br> Re-establishing connection... | |||||
</p> | |||||
<CashLoader /> | |||||
</> | |||||
)} | |||||
<CreateTokenForm | <CreateTokenForm | ||||
BCH={BCH} | BCH={BCH} | ||||
getRestUrl={getRestUrl} | getRestUrl={getRestUrl} | ||||
createToken={createToken} | createToken={createToken} | ||||
disabled={balances.totalBalanceInSatoshis < currency.dustSats} | disabled={balances.totalBalanceInSatoshis < currency.dustSats} | ||||
passLoadingStatus={passLoadingStatus} | passLoadingStatus={passLoadingStatus} | ||||
/> | /> | ||||
{balances.totalBalanceInSatoshis < currency.dustSats && ( | {balances.totalBalanceInSatoshis < currency.dustSats && ( | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |