Skip to content

Commit

Permalink
Fix send/receive buttons on portfolio page (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn authored May 17, 2024
1 parent 31dd5da commit 68dd3fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions centrifuge-app/src/components/Portfolio/Holdings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Thumbnail,
} from '@centrifuge/fabric'
import Decimal from 'decimal.js-light'
import { useHistory, useLocation } from 'react-router-dom'
import { useHistory, useLocation, useRouteMatch } from 'react-router-dom'
import { useTheme } from 'styled-components'
import daiLogo from '../../assets/images/dai-logo.svg'
import ethLogo from '../../assets/images/ethereum.svg'
Expand Down Expand Up @@ -139,6 +139,8 @@ const columns: Column[] = [
export function useHoldings(address?: string, showActions = true) {
const { data: tinlakeBalances } = useTinlakeBalances(address && isEvmAddress(address) ? address : undefined)
const centBalances = useBalances(address && isSubstrateAddress(address) ? address : undefined)
const match = useRouteMatch<{ address: string }>('/portfolio')
const isPortfolioPage = match?.isExact

const wallet = useWallet()
const tinlakePools = useTinlakePools()
Expand Down Expand Up @@ -192,7 +194,7 @@ export function useHoldings(address?: string, showActions = true) {
position: currency.balance.toDecimal(),
tokenPrice: Dec(1),
marketValue: currency.balance.toDecimal(),
showActions: false,
showActions: isPortfolioPage,
connectedNetwork: wallet.connectedNetworkName,
}
}) || []),
Expand All @@ -214,7 +216,7 @@ export function useHoldings(address?: string, showActions = true) {
position: centBalances?.native.balance.toDecimal().sub(centBalances.native.locked.toDecimal()) || Dec(0),
tokenPrice: CFGPrice ? Dec(CFGPrice) : Dec(0),
marketValue: CFGPrice ? centBalances?.native.balance.toDecimal().mul(CFGPrice) ?? Dec(0) : Dec(0),
showActions: false,
showActions: isPortfolioPage,
connectedNetwork: wallet.connectedNetworkName,
},
]
Expand Down

0 comments on commit 68dd3fa

Please sign in to comment.