Skip to content

Commit

Permalink
remove validation, update verbiage
Browse files Browse the repository at this point in the history
  • Loading branch information
jpangelle authored Oct 1, 2023
1 parent 199d947 commit 5915857
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export function ExternalFinanceForm({ loan }: { loan: ExternalLoan }) {
</Field>
<Stack gap={1}>
<Shelf justifyContent="space-between">
<Text variant="emphasized">Total principal</Text>
<Text variant="emphasized">Total amount</Text>
<Text variant="emphasized">
{financeForm.values.price && !Number.isNaN(financeForm.values.price as number)
? formatBalance(
Expand All @@ -209,7 +209,7 @@ export function ExternalFinanceForm({ loan }: { loan: ExternalLoan }) {
</Stack>
<Stack as={Card} gap={2} p={2}>
<Box paddingY={1}>
<Text variant="heading4">To repay the asset, enter face value and settlement price of the asset.</Text>
<Text variant="heading4">To repay the asset, enter face value and settlement price of the transaction.</Text>
</Box>

<Stack>
Expand Down Expand Up @@ -261,17 +261,7 @@ export function ExternalFinanceForm({ loan }: { loan: ExternalLoan }) {
)}) is smaller than
the outstanding balance.`
: ''
},
(val) => {
const num = val instanceof Decimal ? val.toNumber() : val
const repayAmount = Dec(num)
.mul(repayForm.values.faceValue || 1)
.div(loan.pricing.notional.toDecimal())

return repayAmount.gt(debt) ? 'Amount exceeds outstanding' : ''
},
maxPriceVariance(loan.pricing)
)}
}
name="price"
>
{({ field, meta, form }: FieldProps) => {
Expand All @@ -292,7 +282,7 @@ export function ExternalFinanceForm({ loan }: { loan: ExternalLoan }) {
</Field>
<Stack gap={1}>
<Shelf justifyContent="space-between">
<Text variant="emphasized">Total principal</Text>
<Text variant="emphasized">Total amount</Text>
<Text variant="emphasized">
{repayForm.values.price && !Number.isNaN(repayForm.values.price as number)
? formatBalance(
Expand Down

0 comments on commit 5915857

Please sign in to comment.