Skip to content

Commit

Permalink
handle overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Angelle committed Oct 5, 2023
1 parent 69851bb commit 61176e8
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions centrifuge-app/src/components/Portfolio/TokenListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { useTheme } from 'styled-components'
import { usePool } from '../../utils/usePools'
import { Eththumbnail } from '../EthThumbnail'
import { Ellipsis, Root } from '../ListItemCardStyles'
import { Root } from '../ListItemCardStyles'

export type TokenCardProps = AccountTokenBalance

Expand All @@ -40,33 +40,25 @@ export function TokenListItem({ balance, currency, poolId, trancheId }: TokenCar
)}
</Eththumbnail>

<Text as="h2" variant="body2" color="textPrimary">
<Ellipsis>{currency.name}</Ellipsis>
<Text textOverflow="ellipsis" variant="body2">
{currency.name}
</Text>
</Grid>

<Text as="span" variant="body2" color="textPrimary">
<Ellipsis>{formatBalance(balance, currency.symbol)}</Ellipsis>
<Text textOverflow="ellipsis" variant="body2">
{formatBalance(balance, currency.symbol)}
</Text>

<Text as="span" variant="body2" color="textPrimary">
<Ellipsis>
{trancheInfo?.tokenPrice
? formatBalance(trancheInfo.tokenPrice.toDecimal(), trancheInfo.currency.symbol, 4)
: '-'}
</Ellipsis>
<Text textOverflow="ellipsis" variant="body2">
{trancheInfo?.tokenPrice
? formatBalance(trancheInfo.tokenPrice.toDecimal(), trancheInfo.currency.symbol, 4)
: '-'}
</Text>

<Text as="span" variant="body2" color="textPrimary">
<Ellipsis>
{trancheInfo?.tokenPrice
? formatBalance(
balance.toDecimal().mul(trancheInfo.tokenPrice.toDecimal()),
trancheInfo.currency.symbol,
4
)
: '-'}
</Ellipsis>
<Text textOverflow="ellipsis" variant="body2">
{trancheInfo?.tokenPrice
? formatBalance(balance.toDecimal().mul(trancheInfo.tokenPrice.toDecimal()), trancheInfo.currency.symbol, 4)
: '-'}
</Text>

<Shelf gap={2} justifySelf="end">
Expand Down

0 comments on commit 61176e8

Please sign in to comment.