Skip to content

Commit

Permalink
Add feedback review
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Sep 6, 2024
1 parent bc878fb commit d77e883
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions centrifuge-app/src/components/PoolCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { CardHeader } from '../ListItemCardStyles'
import { RouterTextLink } from '../TextLink'
import { PoolStatus, PoolStatusKey } from './PoolStatus'

const StyledCard = styled(Card)`
cursor: pointer;
display: block;
`

type TrancheData = {
name: string
apr: string
Expand All @@ -33,7 +38,7 @@ export type Tranche = {
id: string
currency: {
name: string
decimals: CurrencyBalance | number
decimals: number
}
interestRatePerSec: {
toAprPercent: () => Decimal
Expand Down Expand Up @@ -84,6 +89,10 @@ export function PoolCard({
const words = tranche.currency.name.trim().split(' ')
const metadata = metaData?.tranches[tranche.id] ?? null
const trancheName = words[words.length - 1]
const investmentBalance = new CurrencyBalance(
metadata?.minInitialInvestment ?? 0,
tranche.currency.decimals
).toDecimal()

return {
name: trancheName,
Expand All @@ -94,20 +103,18 @@ export function PoolCard({
})
: '-',
minInvestment:
metadata && metadata.minInitialInvestment
? formatBalanceAbbreviated(Number(metadata.minInitialInvestment), '', 0)
: '-',
metadata && metadata.minInitialInvestment ? formatBalanceAbbreviated(investmentBalance, '', 0) : '-',
}
}) as TrancheData[]

return (
<Card
<StyledCard
marginRight={20}
marginBottom={20}
onClick={() => navigate(`/pools/${poolId}`)}
padding={18}
style={{ cursor: 'pointer' }}
height={320}
as={'a'}
>
<CardHeader marginBottom={12}>
<Box>
Expand Down Expand Up @@ -177,6 +184,6 @@ export function PoolCard({
<Text variant="body2">Investor Type</Text>
<Text variant="body2"> {metaData?.pool?.investorType || '-'}</Text>
</Box>
</Card>
</StyledCard>
)
}

0 comments on commit d77e883

Please sign in to comment.