Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
0c73372
feat: spruce
Apr 19, 2023
17e4589
fixed issues after master merge
0xbarbs May 2, 2023
1094df1
fix: protocol data contract version issue
0xbarbs May 2, 2023
542899a
remove debug log
0xbarbs May 2, 2023
f5ea3b8
fix: factor in repay block number diff for versioned block number
0xbarbs May 2, 2023
8e43574
UNI-1045 Approval permit functionality (NEW) (#105)
0xbarbs May 4, 2023
07689ef
fix: rework owed balance margin calculation to prevent dust issues
0xbarbs May 4, 2023
0fa50d8
feat: locked stakers now link to contacts table with borrowing filter…
0xbarbs May 4, 2023
08eb9d6
feat: display contact modal on contacts page if clicked in active bor…
0xbarbs May 4, 2023
dda45f8
fix: responsive style issues
0xbarbs May 6, 2023
545a107
fix: repayment issues
0xbarbs May 6, 2023
5cc1fcf
fixed more review tweaks/changes
0xbarbs May 6, 2023
ec548e9
bump @unioncredit/ui version
0xbarbs May 6, 2023
8d91278
bump: @unioncredit/ui version
0xbarbs May 6, 2023
69994f1
UNI-1250 Add tooltip content #114
0xbarbs May 15, 2023
4432a88
UNI-1388 Cancel vouch functionality (#113)
0xbarbs May 16, 2023
a00444c
UNI-1380 Get started page fixes (#115)
0xbarbs May 18, 2023
4cec781
UNI-1409 Added navigation controls to contacts modal (#116)
0xbarbs May 18, 2023
0f43b09
proj: bump @unioncredit/ui version
0xbarbs May 18, 2023
e1f9045
Updated "Unavailable" credit tooltip copy
0xmurf May 19, 2023
42229a0
UNI-1435 Claim tokens button doesnt work on get started #117
0xbarbs May 22, 2023
f4fedf4
UNI-1434 Rework estimated reward calculations (#118)
0xbarbs May 22, 2023
2b0a6bd
UNI-1411 Segmented control animation (#119)
0xbarbs May 22, 2023
c897a02
UNI-1404 Tweaked segmented control transitions #120
0xbarbs May 22, 2023
b9d83f7
UNI-1358 Increased precision of max borrow calculation #122
0xbarbs May 22, 2023
700a2e2
UNI-908 Add transitions to modals (#123)
0xbarbs May 22, 2023
5aaf7e4
UNI-1430 Update button text when revoking vouch (#126)
0xbarbs May 22, 2023
88a31b4
UNI-1423 Update button text to specify it is cancelling the received …
0xbarbs May 22, 2023
9decbb4
UNI-1373 Add eslint to interface (#124)
0xbarbs May 22, 2023
9c1abce
added missing prop
0xbarbs May 22, 2023
54707c9
feat: added back buffer window var
0xbarbs May 22, 2023
00bcfaa
proj: only eslint the src directory
0xbarbs May 22, 2023
a210327
UNI-1448 Interest rates not calculating correctly #128
0xbarbs May 24, 2023
7ca8add
UNI-626 Improve display of proposal action items (#145)
0xbarbs May 26, 2023
2681426
feat: show mainnet leaderboard contacts for all networks (#146)
0xbarbs May 26, 2023
ec83699
feat: added truncating of ens names (#144)
0xbarbs May 26, 2023
73056f7
fix: added hover style to wallet/profile header buttons (#143)
0xbarbs May 26, 2023
2677fbe
fix: display network name in wallet balance text (#142)
0xbarbs May 26, 2023
9833df2
feat: fetch time to default and time to write-off values from the con…
0xbarbs May 26, 2023
41e2d6f
fix: bottom corners were overflowing parent container (#140)
0xbarbs May 26, 2023
c7cce2c
feat: updated tooltip icon to correct version (#139)
0xbarbs May 26, 2023
a357f5a
UNI-1424 Contact table top bar tweaks and adjustments (#138)
0xbarbs May 26, 2023
304814f
feat: tweaked contact numerical row font inline with design (#134)
0xbarbs May 26, 2023
12c8605
feat: added build info and links to the repository (#133)
0xbarbs May 26, 2023
80c6d6d
fix: remove hardcoding of app deployment (#130)
0xbarbs May 26, 2023
81b57e7
fix: active borrowers table overflows on smaller screens (#129)
0xbarbs May 26, 2023
e8f8918
feat: default v2 (#147)
May 26, 2023
8c24185
feat: loading screen when switching versions (#148)
May 26, 2023
a324f47
fix: event listeners (#149)
May 26, 2023
99b4b26
UNI-1427 Fixed loan status sort (#131)
0xbarbs May 26, 2023
b486407
UNI-1421 Add edit alias functionality to contact modal (#132)
0xbarbs May 26, 2023
15fbc3b
UNI-1416 Only show staked funds warning on V2 networks (#135)
0xbarbs May 26, 2023
195765b
UNI-1414 Incorrect spacing on modal input and input title #136
0xbarbs May 26, 2023
adb476e
UNI-1451 Added get started mobile progress list #137
0xbarbs May 26, 2023
3a41279
UNI-1452 Network switcher improvements #150
0xbarbs May 26, 2023
c0fc36f
UNI-1429 Styling issues with wallet activity modal #151
0xbarbs May 26, 2023
ce6c845
UNI-1428 Added minimum width to loan status column #152
0xbarbs May 26, 2023
fc865c1
UNI-1418 Made ENS label blue #153
0xbarbs May 26, 2023
ca78a1d
UNI-1425 Color issues on spruce #155
0xbarbs May 30, 2023
cf1d787
Arrow Glyph
0xmurf Jun 1, 2023
1681ebc
Merge branch 'develop' of https://github.com/unioncredit/union-interf…
0xmurf Jun 1, 2023
2a90de5
UNI-1469 Fixed last payment calculation on contacts table #160
0xbarbs Jun 2, 2023
580ef89
UNI-1450 Prevent contact navigation from overflowing the window #158
0xbarbs Jun 2, 2023
44f224e
UNI-1438 Reworked governance balances #157
0xbarbs Jun 2, 2023
03f72fd
UNI-1408 Correctly display dust and reduce minimum payment to 0.01 (#…
0xbarbs Jun 2, 2023
111935c
UNI-1262 Check there is enough uDAI balance when borrowing #161
0xbarbs Jun 2, 2023
7cf3754
UNI-1449 Fixed contact table crashing #162
0xbarbs Jun 5, 2023
f82a5f2
fix: borrowable sort
0xbarbs Jun 6, 2023
9e15f99
Merge remote-tracking branch 'origin/develop' into develop
0xbarbs Jun 6, 2023
5fdd4ec
UNI-1480 Fix get started page and network select options #163
0xbarbs Jun 7, 2023
4e853ae
UNI-1481 Correct contact not showing using URL param filter #164
0xbarbs Jun 7, 2023
9397415
UNI-1485 Updated max overdue days calculation #165
0xbarbs Jun 7, 2023
637d59c
UNI-1477 Added etherscan link to view bytecode button #166
0xbarbs Jun 7, 2023
7abe1e9
UNI-1441 Added optimism v2 banner #167
0xbarbs Jun 7, 2023
6d00fdb
UNI-1475 Added 404 page (#168)
0xbarbs Jun 9, 2023
99788b4
UNI-1419 Hide vouchee details if vouch is <= 0 #169
0xbarbs Jun 9, 2023
2250a61
UNI-1483 Providing and receving toggle style changes (#170)
0xbarbs Jun 9, 2023
114bbba
Revert "UNI-1419 Hide vouchee details if vouch is <= 0 #169" (#172)
0xbarbs Jun 12, 2023
7fdc7f0
fix: adjust info banner styles
0xbarbs Jun 12, 2023
c7da0ea
chg: add base sepolia support
maxweng Mar 16, 2024
0925ed9
chg: add 84532 network
twygod Mar 16, 2024
0d0870e
chg: add base sepolia support
maxweng Mar 18, 2024
7a0452d
chg: update lens address and add error handling
twygod Mar 18, 2024
42f0531
chg: add usdc
twygod Mar 20, 2024
9c744a9
chg: update erc20 token component
twygod Mar 20, 2024
e25423f
chg: update ui
twygod Mar 20, 2024
1e3a5f2
chg: token number of digits
twygod Mar 20, 2024
18ecff9
chg: update token unit
twygod Mar 21, 2024
b16155c
chg: token number of digits
twygod Mar 21, 2024
8374903
fix: unit error
twygod Mar 21, 2024
a1ff36c
chg: update address
twygod Mar 26, 2024
df2008a
fix: unit error
twygod Mar 27, 2024
039c73c
Merge branch 'master' into feature/uni-1800-add-sepolia-and-base-sepo…
twygod Apr 1, 2024
966b599
chg: add default useToken
twygod Apr 2, 2024
481a033
Merge branch 'develop' into feature/uni-1800-add-sepolia-and-base-sep…
maxweng Apr 2, 2024
2a42af7
chg: update address and @unioncredit/ui
twygod Sep 20, 2024
e8c01e6
Merge branch 'master' into feature/uni-1800-add-sepolia-and-base-sepo…
twygod Sep 20, 2024
b0ed8b2
fix: format use error token
twygod Sep 20, 2024
d635952
chg: update contract address
twygod Sep 20, 2024
7032b49
fix: @unioncredit/ui lib url
maxweng Sep 23, 2024
44b70d4
chg: update registerHelper and referral
twygod Sep 23, 2024
c55fa16
feat: bump ui lib vers
0xbarbs Sep 24, 2024
a8caf80
chg: add base network address and config
twygod Oct 31, 2024
a24279c
chg: update address
twygod Nov 1, 2024
4ca0a69
Merge branch 'feature/uni-1800-add-sepolia-and-base-sepolia-support-i…
twygod Nov 1, 2024
3f966e6
fix: error base rpc and add chainUseTokens config
twygod Nov 1, 2024
46b0e1a
fix: minMargin calc error
twygod Nov 1, 2024
f7f727b
fix: register fee show error
twygod Nov 1, 2024
092f608
UNI-2106 Show correct token when selecting a network #379
0xbarbs Nov 1, 2024
d64ecc2
fix: use 18 decimals when calculating origination fee percentage
0xbarbs Nov 1, 2024
8e4ec5d
UNI-2107 Use base icon and colors for base network #380
0xbarbs Nov 1, 2024
25c4ba1
UNI-2108 Profiles crashing on all networks #381
0xbarbs Nov 4, 2024
5d7aa34
UNI-2112 Network selector overflows vouch link modal #382
0xbarbs Nov 4, 2024
de56523
UNI-2123 Trigger wallet on mobile (#383)
0xbarbs Nov 4, 2024
127fa1d
UNI-2122 Use correct token in tx toasts #384
0xbarbs Nov 5, 2024
f6f2327
feat: output projectId
0xbarbs Nov 5, 2024
568d3a2
UNI-2110 Create useToken to determine which symbol/units/wad to displ…
0xbarbs Nov 5, 2024
b0b0ab3
UNI-2134 Use token symbol in place of generic token string #386
0xbarbs Nov 5, 2024
609bca0
UNI-2138 Token null when not connected to a network #387
0xbarbs Nov 5, 2024
4888558
UNI-2129 Profile network selector not loading base data #389
0xbarbs Nov 6, 2024
e576663
UNI-2132 Wrong payment due date on borrow modal #390
0xbarbs Nov 6, 2024
1ccae79
Merge branch 'refs/heads/master' into base-mainnet
0xbarbs Nov 6, 2024
a603908
fix: remove duplicate import
0xbarbs Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23,259 changes: 23,259 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@unioncredit/data": "^1.0.21",
"@unioncredit/data": "^1.0.22",
"@unioncredit/ui": "2.0.42",
"@vercel/analytics": "^1.1.1",
"@walletconnect/modal": "^2.5.8",
Expand Down Expand Up @@ -63,6 +63,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"eslint": "^8.40.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0"
Expand Down
Binary file added public/networks/base-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/components/Token.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Dai, Usdc } from "@unioncredit/ui";

import { TOKENS } from "constants";
import { useToken } from "hooks/useToken";

export default function Token(props) {
const { token } = useToken();
return token === TOKENS.USDC ? <Usdc {...props} /> : <Dai {...props} />;
}
4 changes: 2 additions & 2 deletions src/components/connect/Banner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default function Banner() {
<div className="ConnectBanner">
<Box maxw="411px" w="90%" px="8px">
<Heading m={0} align="center">
<span className="ConnectBanner__bold">Welcome to Union</span>, the
place to create, manage and grow your on-chain credit
<span className="ConnectBanner__bold">Welcome to Union</span>, the place to create, manage
and grow your on-chain credit
</Heading>
</Box>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/components/connect/NetworkSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import { useAccount, useNetwork, useSwitchNetwork } from "wagmi";
import { NetworkSelectOption } from "./NetworkSelectOption";
import useMemberSummary from "hooks/useMemberSummary";
import { useAppNetwork } from "providers/Network";
import { useSettings } from "providers/Settings";
import { supportedNetworks } from "config/networks";
import { useSupportedNetwork } from "../../hooks/useSupportedNetwork";

export default function NetworkSelect() {
const { chain } = useNetwork();
const { settings } = useSettings();
const { address, isConnected } = useAccount();
const { setForceAppReady } = useAppNetwork();
const { openConnectModal } = useConnectModal();
Expand Down Expand Up @@ -66,6 +64,7 @@ export default function NetworkSelect() {
key={network.id}
address={address}
network={network}
token={network.token}
disabled={!isConnected}
onClick={() => handleChangeNetwork(network)}
active={isConnected && selected?.chainId === network.chainId}
Expand Down
21 changes: 4 additions & 17 deletions src/components/connect/NetworkSelectOption.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import cn from "classnames";
import format from "utils/format";
import useMemberSummary from "hooks/useMemberSummary";

export const NetworkSelectOption = ({
address,
network,
active,
disabled,
onClick,
}) => {
export const NetworkSelectOption = ({ address, network, token, active, disabled, onClick }) => {
const { label, value, avatar, description, chainId } = network;
const { data } = useMemberSummary(address, chainId);

Expand All @@ -26,12 +20,7 @@ export const NetworkSelectOption = ({
})}
>
<Box align="center" h="64px">
<Box
fluid
p="12px"
className="NetworkSelectOption__contentBox"
align="center"
>
<Box fluid p="12px" className="NetworkSelectOption__contentBox" align="center">
<Box justify="center" mr="16px">
<Avatar size={40} src={avatar} />
</Box>
Expand All @@ -41,14 +30,12 @@ export const NetworkSelectOption = ({
</Text>

<Box align="center">
{data.isMember && (
<CheckIcon className="NetworkSelectOption__check" />
)}
{data.isMember && <CheckIcon className="NetworkSelectOption__check" />}

<Text grey={600} m={0} pr="8px" size="small">
{address
? data.isMember
? `Member · ${format(data.creditLimit)} DAI available`
? `Member · ${format(data.creditLimit, token)} ${token} available`
: "Not a member"
: description}
</Text>
Expand Down
10 changes: 5 additions & 5 deletions src/components/contacts/ContactsTable/ProvidingTableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import format from "utils/format";
import cn from "classnames";
import { DimmableTableCell } from "components/contacts/ContactsTable/DimmableTableCell";
import { useLastRepayData } from "hooks/useLastRepayData";

import { ReactComponent as BothRow } from "../../../images/BothRow.svg";
import { ReactComponent as ProvidingRow } from "../../../images/ProvidingRow.svg";
import { ReactComponent as ReceivingRow } from "../../../images/ReceivingRow.svg";
import { useToken } from "hooks/useToken";

export const COLUMNS = {
TRUST_SET: {
Expand All @@ -38,7 +38,7 @@ export const COLUMNS = {

export function ProvidingTableRow({ data, active, setContact, providing, receiving }) {
const { address, isOverdue, locking = ZERO, trust = ZERO, vouch = ZERO, lastRepay = ZERO } = data;

const { token } = useToken();
const { formatted: lastRepayFormatted, paymentDue } = useLastRepayData(lastRepay);

const Icon = receiving ? (providing ? BothRow : ReceivingRow) : ProvidingRow;
Expand All @@ -50,7 +50,7 @@ export function ProvidingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.TRUST_SET.id}
dimmed={trust.eq(ZERO)}
value={`${format(trust)} DAI`}
value={`${format(trust, token)} ${token}`}
/>
),
},
Expand All @@ -60,7 +60,7 @@ export function ProvidingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.TOTAL_VOUCH.id}
dimmed={vouch.eq(ZERO)}
value={`${format(vouch)} DAI`}
value={`${format(vouch, token)} ${token}`}
/>
),
},
Expand All @@ -70,7 +70,7 @@ export function ProvidingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.STAKE_LOCKED.id}
dimmed={locking.eq(ZERO)}
value={`${format(locking)} DAI`}
value={`${format(locking, token)} ${token}`}
className={cn({
"table-cell--overdue": isOverdue && locking.gt(ZERO),
})}
Expand Down
13 changes: 8 additions & 5 deletions src/components/contacts/ContactsTable/ReceivingTableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DimmableTableCell } from "components/contacts/ContactsTable";
import { ReactComponent as BothRow } from "../../../images/BothRow.svg";
import { ReactComponent as ProvidingRow } from "../../../images/ProvidingRow.svg";
import { ReactComponent as ReceivingRow } from "../../../images/ReceivingRow.svg";
import { useToken } from "hooks/useToken";

export const COLUMNS = {
TRUST_SET: {
Expand All @@ -35,6 +36,8 @@ export const COLUMNS = {
};

export function ReceivingTableRow({ data, active, setContact, providing, receiving }) {
const { token } = useToken();

const { address, locking = ZERO, trust = ZERO, vouch = ZERO } = data;

const borrowable = vouch.sub(locking);
Expand All @@ -48,7 +51,7 @@ export function ReceivingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.TRUST_SET.id}
dimmed={trust.eq(ZERO)}
value={`${format(trust)} DAI`}
value={`${format(trust, token)} ${token}`}
/>
),
},
Expand All @@ -58,7 +61,7 @@ export function ReceivingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.TOTAL_VOUCH.id}
dimmed={vouch.eq(ZERO)}
value={`${format(vouch)} DAI`}
value={`${format(vouch, token)} ${token}`}
/>
),
},
Expand All @@ -68,7 +71,7 @@ export function ReceivingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.REAL_VOUCH.id}
dimmed={vouch.eq(ZERO)}
value={`${format(vouch)} DAI`}
value={`${format(vouch, token)} ${token}`}
/>
),
},
Expand All @@ -78,7 +81,7 @@ export function ReceivingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.LOCKING.id}
dimmed={locking.eq(ZERO)}
value={`${format(locking)} DAI`}
value={`${format(locking, token)} ${token}`}
/>
),
},
Expand All @@ -88,7 +91,7 @@ export function ReceivingTableRow({ data, active, setContact, providing, receivi
<DimmableTableCell
key={COLUMNS.BORROWABLE.id}
dimmed={borrowable.eq(ZERO)}
value={`${format(borrowable)} DAI`}
value={`${format(borrowable, token)} ${token}`}
/>
),
},
Expand Down
74 changes: 29 additions & 45 deletions src/components/credit/CreditStats.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import "./CreditStats.scss";

import cn from "classnames";
import { BigNumber } from "ethers";
import { useNetwork } from "wagmi";
import makeUrls from "add-event-to-calendar";
import {
Badge,
BadgeIndicator,
BadgeRow,
BorrowIcon,
Box,
Button,
Expand Down Expand Up @@ -33,14 +33,13 @@ import { useModals } from "providers/ModalManager";
import { BORROW_MODAL } from "components/modals/BorrowModal";
import { useVersionBlockNumber } from "hooks/useVersionBlockNumber";
import useResponsive from "hooks/useResponsive";
import makeUrls from "add-event-to-calendar";
import React from "react";
import { BigNumber } from "ethers";
import { useToken } from "hooks/useToken";

export default function CreditStats({ vouchers }) {
const { open } = useModals();
const { chain: connectedChain } = useNetwork();
const { isMobile } = useResponsive();
const { token } = useToken();

const { data: member = {} } = useMember();
const { data: protocol = {} } = useProtocol();
Expand Down Expand Up @@ -95,18 +94,17 @@ export default function CreditStats({ vouchers }) {
<Card.Body>
<Box align="center" justify="space-between">
<NumericalBlock
token="dai"
token={`${token.toLowerCase()}`}
title="Available to Borrow"
align="left"
smallDecimals={true}
value={format(creditLimit)}
value={format(creditLimit, token)}
/>

<Button
size="large"
label="Borrow"
icon={BorrowIcon}
disabled={isOverdue}
className="BorrowButton"
onClick={() => open(BORROW_MODAL)}
/>
Expand All @@ -116,45 +114,45 @@ export default function CreditStats({ vouchers }) {
m="24px 0 12px"
items={[
{
value: formattedNumber(owed),
color: "blue900",
value: formattedNumber(owed, token),
color: "blue300",
},
{
value: formattedNumber(creditLimit, 2, false),
color: "blue100",
value: formattedNumber(creditLimit, token, 2, false),
color: "blue800",
},
{
value: formattedNumber(unavailableBalance),
value: formattedNumber(unavailableBalance, token),
color: "amber500",
},
]}
/>

<Box className="CreditStats__BorrowStats" align="center">
<Box align="center" className="CreditStats__Legend">
<Dot color="blue900" mr="4px" />
<Dot color="blue300" mr="4px" />

<Heading level={3} grey={500} m={0} weight="medium" size="small">
Borrowed
<Tooltip
ml="4px"
title={`${format(owed)} DAI`}
content="The amount of DAI you are currently borrowing"
title={`${format(owed, token)} ${token}`}
content={`The amount of ${token} you are currently borrowing`}
>
<InfoOutlinedIcon width="13px" />
</Tooltip>
</Heading>
</Box>

<Box align="center" className="CreditStats__Legend">
<Dot color="blue100" mr="4px" />
<Dot color="blue800" mr="4px" />

<Heading level={3} grey={500} m={0} weight="medium" size="small">
Available
<Tooltip
ml="4px"
title={`${format(creditLimit, 2, false)} DAI`}
content="The amount of DAI currently available to borrow"
title={`${format(creditLimit, token, 2, false)} ${token}`}
content={`The amount of ${token} currently available to borrow`}
>
<InfoOutlinedIcon width="13px" />
</Tooltip>
Expand All @@ -168,7 +166,7 @@ export default function CreditStats({ vouchers }) {
Unavailable
<Tooltip
ml="4px"
title={`${format(unavailableBalance)} DAI`}
title={`${format(unavailableBalance, token)} ${token}`}
content="Credit normally available to you which is tied up elsewhere and unavailable to borrow at this time"
>
<InfoOutlinedIcon width="13px" />
Expand All @@ -178,18 +176,13 @@ export default function CreditStats({ vouchers }) {
</Box>
</Card.Body>

<Card.Footer
direction="vertical"
className={cn("Card__footer", {
MaxOverdue: isMaxOverdue,
})}
>
<Card.Footer direction="vertical">
<Box mb="24px" align="center" justify="space-between" fluid>
<NumericalBlock
token="dai"
token={`${token.toLowerCase()}`}
title="Balance owed"
align="left"
value={format(owed)}
value={format(owed, token)}
smallDecimals={true}
/>

Expand All @@ -215,30 +208,21 @@ export default function CreditStats({ vouchers }) {
>
<Box className="PaymentDueInfo" direction="vertical">
<Box align="center">
{isOverdue && (
<WarningIcon className="WarningIcon" width="21px" style={{ marginRight: "6px" }} />
)}
{isOverdue && <WarningIcon width="21px" style={{ marginRight: "6px" }} />}

<Text m={0} size="medium" weight="medium" grey={600}>
<Text m={0} size="medium" weight="medium" grey={500}>
{isOverdue ? `${relativeDueDate} Overdue` : "Next payment due"}
</Text>
</Box>

{isMaxOverdue ? (
<BadgeRow mt="8px">
<Badge color="white" label={`${format(minPayment)} DAI · ${absoluteDueDate}`} />
<BadgeIndicator color="red500" textColor="red500" label="Write-Off" />
</BadgeRow>
<BadgeIndicator mt="8px" color="red500" textColor="red500" label="Write-Off" />
) : (
<BadgeIndicator
mt="8px"
color="orange500"
textColor="grey500"
ml="-3px"
label={
owed.lte(0) ? "No payment due" : `${format(minPayment)} DAI · ${absoluteDueDate}`
}
/>
<Text m="4px 0 0" size="medium">
{owed.lte(0)
? "No payment due"
: `${format(minPayment, token)} ${token} · ${absoluteDueDate}`}
</Text>
)}
</Box>

Expand Down
Loading