Skip to content

Commit

Permalink
Fix labels (#1480)
Browse files Browse the repository at this point in the history
* Fix loan labels

* assigns condition value to descriptive variable

---------

Co-authored-by: Jeroen Offerijns <[email protected]>
  • Loading branch information
Hornebom and hieronx authored Jun 29, 2023
1 parent 7429b9b commit 04064c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions centrifuge-app/src/components/LoanLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export function getLoanLabelStatus(l: Loan | TinlakeLoan): [LabelStatus, string]
if (l.status === 'Created') return ['default', 'Created']

if (l.status === 'Active' && 'maturityDate' in l.pricing && l.pricing.maturityDate) {
const isTinlakeLoan = 'riskGroup' in l
if (isTinlakeLoan) return ['info', 'Ongoing']

const days = daysBetween(today, l.pricing.maturityDate)
if (days === 0) return ['warning', 'Due today']
if (days === 1) return ['warning', 'Due tomorrow']
Expand Down

0 comments on commit 04064c7

Please sign in to comment.