From 3938b22ab91b4b3e9f4d9668d95ca3a9e454b6c4 Mon Sep 17 00:00:00 2001 From: JP Angelle Date: Wed, 4 Oct 2023 13:00:20 -0500 Subject: [PATCH] fix logo --- .../src/components/Portfolio/TokenListItem.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/centrifuge-app/src/components/Portfolio/TokenListItem.tsx b/centrifuge-app/src/components/Portfolio/TokenListItem.tsx index 6903b388c9..3980a82cf3 100644 --- a/centrifuge-app/src/components/Portfolio/TokenListItem.tsx +++ b/centrifuge-app/src/components/Portfolio/TokenListItem.tsx @@ -1,5 +1,5 @@ -import { AccountTokenBalance, PoolMetadata } from '@centrifuge/centrifuge-js' -import { formatBalance } from '@centrifuge/centrifuge-react' +import { AccountTokenBalance } from '@centrifuge/centrifuge-js' +import { formatBalance, useCentrifuge } from '@centrifuge/centrifuge-react' import { AnchorButton, Box, @@ -13,7 +13,7 @@ import { Thumbnail, } from '@centrifuge/fabric' import styled, { useTheme } from 'styled-components' -import { usePool } from '../../utils/usePools' +import { usePool, usePoolMetadata } from '../../utils/usePools' import { Eththumbnail } from '../EthThumbnail' import { Root } from '../ListItemCardStyles' import { COLUMN_GAPS } from './InvestedTokens' @@ -27,11 +27,13 @@ const TokenName = styled(Text)` export function TokenListItem({ balance, currency, poolId, trancheId }: TokenCardProps) { const { sizes } = useTheme() const pool = usePool(poolId, false) + const { data: metadata } = usePoolMetadata(pool) + const cent = useCentrifuge() const isTinlakePool = poolId.startsWith('0x') const trancheInfo = pool?.tranches.find(({ id }) => id === trancheId) - const icon = (trancheInfo?.poolMetadata as PoolMetadata).tranches?.[trancheId].icon?.uri + const icon = metadata?.pool?.icon?.uri ? cent.metadata.parseMetadataUrl(metadata.pool.icon.uri) : null return (