Skip to content

Commit

Permalink
Fix balance in select address preview
Browse files Browse the repository at this point in the history
  • Loading branch information
samchuk-vlad committed Sep 19, 2023
1 parent bf7ae6a commit 5dda5c7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/profiles/address-views/AuthorPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Popover } from 'antd'
import BN from 'bn.js'
import React from 'react'
import { ProfileData } from 'src/types'
import { BalanceByNetwork } from '../../common/balances/Balance'
import { BalanceByNetwork, NativeBalance } from '../../common/balances/Balance'
import AuthorSpaceAvatar from './AuthorSpaceAvatar'
import Name from './Name'
import { ProfilePreviewPopup } from './ProfilePreview'
Expand All @@ -18,11 +18,19 @@ export type InfoProps = {
}

export const InfoDetails: React.FC<InfoProps> = ({ details, balance, address, network }) => {
const accountBalance =
(address &&
(network ? (
<BalanceByNetwork address={address} network={network} />
) : (
<NativeBalance address={address.toString()} />
))) ||
null

return (
<>
<div className='Df--AddressComponents-details'>
{balance ||
(address && <BalanceByNetwork address={address.toString()} network={network} />)}
{balance || accountBalance}
{details && <div>{details}</div>}
</div>
</>
Expand Down

0 comments on commit 5dda5c7

Please sign in to comment.