Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Commit

Permalink
display dxTokenBalance even if tokenBalance == 0 (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
Velenir authored and W3stside committed Oct 8, 2018
1 parent 641ecb8 commit 83efd2e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/MenuWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,21 @@ export class MenuWallet extends React.Component<WalletProps, WalletState> {
{Object.keys(tokens).map((addressKey: any) => {
if (!addressToSymbolDecimal[addressKey]) return null
const { name, decimals } = addressToSymbolDecimal[addressKey]
const tokenBalAvailable = tokens[addressKey].gt(0)
const dxTokenAvailable = dxBalances[addressKey]
const dxTokenBalAvailable = dxTokenAvailable && dxBalances[addressKey].gt(0)

return (
tokens[addressKey].gt(0) &&
(tokenBalAvailable || dxTokenBalAvailable) &&
<tr key={addressKey}>
<td>{name || 'Unknown'}</td>
<td>{(tokens[addressKey]).div(10 ** decimals).toFixed(FIXED_DECIMALS)}</td>

{// Conditionally render dxBalances column
dxBalancesAvailable &&
<td className={dxBalances[addressKey] && dxBalances[addressKey].gt(0) ? 'withPic' : ''}>
{dxBalances[addressKey] && dxBalances[addressKey].div(10 ** decimals).toFixed(FIXED_DECIMALS)}
{dxBalances[addressKey] && dxBalances[addressKey].gt(0) &&
<td className={dxTokenBalAvailable ? 'withPic' : ''}>
{dxTokenAvailable && dxBalances[addressKey].div(10 ** decimals).toFixed(FIXED_DECIMALS)}
{dxTokenBalAvailable &&
<img
src={require('assets/claim.svg')}
onClick={() => withdrawFromDutchX({ name, address: addressKey })}
Expand Down

0 comments on commit 83efd2e

Please sign in to comment.