Skip to content

Commit

Permalink
Fix template rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Jul 31, 2024
1 parent 3ce899a commit 8fc9755
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions centrifuge-app/src/pages/Loan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ import { useBorrowerAssetTransactions, usePool, usePoolMetadata } from '../../ut
import { FinanceForm } from './FinanceForm'
import { HoldingsValues } from './HoldingsValues'
import { KeyMetrics } from './KeyMetrics'
import { MetricsTable } from './MetricsTable'
import { PricingValues } from './PricingValues'
import { RepayForm } from './RepayForm'
import { TransactionTable } from './TransactionTable'
import { isCashLoan, isExternalLoan } from './utils'
import { formatNftAttribute, isCashLoan, isExternalLoan } from './utils'

const FullHeightLayoutBase = styled(LayoutBase)`
height: 100vh;
Expand Down Expand Up @@ -235,21 +236,24 @@ function Loan() {
<Text fontSize="18px" fontWeight="500">
{section.name}
</Text>

{/* TODO: what is this doing here? <TransactionTable
transactions={borrowerAssetTransactions}
currency={pool.currency.symbol}
loanType={
'valuationMethod' in loan.pricing && loan.pricing.valuationMethod === 'oracle'
? 'external'
: 'internal'
}
poolType={poolMetadata?.pool?.asset.class}
decimals={pool.currency.decimals}
pricing={loan.pricing as PricingInfo}
maturityDate={loan.pricing.maturityDate ? new Date(loan.pricing.maturityDate) : undefined}
originationDate={originationDate ? new Date(originationDate) : undefined}
/> */}
<MetricsTable
metrics={section.attributes
.filter(
(key) =>
!!templateData.attributes?.[key] &&
(!templateMetadata?.keyAttributes ||
!Object.values(templateMetadata?.keyAttributes).includes(key))
)
.map((key) => {
const attribute = templateData.attributes?.[key]!
const value = publicData[key]
const formatted = value ? formatNftAttribute(value, attribute) : '-'
return {
label: attribute.label,
value: formatted,
}
})}
/>
</Stack>
</Card>
</React.Suspense>
Expand Down

0 comments on commit 8fc9755

Please sign in to comment.