Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Oct 24, 2024
1 parent 1b43e4f commit f726502
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function AssetPerformanceChart({ pool, poolId, loanId }: Props) {
if (!assetSnapshots) return <Spinner style={{ margin: 'auto', height: 350 }} />

return (
<Card p={3} height={280} borderColor={theme.colors.borderSecondary}>
<Card p={3} height={320} borderColor={theme.colors.borderSecondary}>
<Stack gap={2}>
<Box display="flex">
<Text variant="heading4">
Expand All @@ -152,7 +152,11 @@ function AssetPerformanceChart({ pool, poolId, loanId }: Props) {
</Text>
</Box>

{isChartEmpty && <Text variant="label1">No data yet</Text>}
{isChartEmpty && (
<Text variant="body3" style={{ margin: '80px auto 0px' }}>
No data available
</Text>
)}

{!(assetSnapshots && assetSnapshots[0]?.currentPrice?.toString() === '0') && (
<Stack>
Expand Down
14 changes: 8 additions & 6 deletions centrifuge-app/src/pages/Loan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ActionButtons({ loan }: { loan: LoanType }) {
const [correctionShown, setCorrectionShown] = React.useState(false)
if (!loan || !canBorrow || isTinlakeLoan(loan) || !canBorrow || loan.status === 'Closed') return null
return (
<>
<Box marginLeft="auto">
<Drawer isOpen={financeShown} onClose={() => setFinanceShown(false)} innerPaddingTop={2}>
<LoadBoundary>
<FinanceForm loan={loan} />
Expand All @@ -90,22 +90,22 @@ function ActionButtons({ loan }: { loan: LoanType }) {
<Shelf gap={2}>
{!(loan.pricing.maturityDate && new Date() > new Date(loan.pricing.maturityDate)) ||
!loan.pricing.maturityDate ? (
<Button onClick={() => setFinanceShown(true)} small>
<Button onClick={() => setFinanceShown(true)} small variant="secondary">
{isCashLoan(loan) ? 'Deposit' : isExternalLoan(loan) ? 'Purchase' : 'Finance'}
</Button>
) : null}
{loan.outstandingDebt.gtn(0) && (
<Button onClick={() => setRepayShown(true)} small>
<Button onClick={() => setRepayShown(true)} small variant="inverted">
{isCashLoan(loan) ? 'Withdraw' : isExternalLoan(loan) ? 'Sell' : 'Repay'}
</Button>
)}
{loan.outstandingDebt.gtn(0) && (
<Button onClick={() => setCorrectionShown(true)} small>
<Button onClick={() => setCorrectionShown(true)} small variant="inverted">
Correction
</Button>
)}
</Shelf>
</>
</Box>
)
}

Expand Down Expand Up @@ -171,7 +171,9 @@ function Loan() {
value: `${formatBalance(getCurrentValue(), pool.currency.symbol, 2, 2)}`,
},
]}
/>
>
<ActionButtons loan={loan} />
</AssetSummary>

{loanId === '0' && (
<PageSection>
Expand Down
3 changes: 0 additions & 3 deletions centrifuge-app/src/pages/Pool/Assets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export function PoolDetailAssets() {
const cashLoans = (loans ?? []).filter(
(loan) => 'valuationMethod' in loan.pricing && loan.pricing.valuationMethod === 'cash'
)
const nonCashLoans = (loans ?? []).filter(
(loan) => 'valuationMethod' in loan.pricing && loan.pricing.valuationMethod !== 'cash'
)

if (!pool) return null

Expand Down

0 comments on commit f726502

Please sign in to comment.