Skip to content

Commit

Permalink
[x] Mint Asset, add Orange for Risky level
Browse files Browse the repository at this point in the history
[x] Borrow Limit:
		Safe <50%
		Risky 50 - 80%
		Danger >80%

Signed-off-by: antonnell <[email protected]>
  • Loading branch information
antonnell committed Nov 26, 2021
1 parent 3835ab5 commit 0711db1
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 13 deletions.
3 changes: 3 additions & 0 deletions components/ffMintOverview/ffOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ export default function ffOverview() {
`${formatCurrency(position && position.length >= 3 ? position[3] / 100 : 0)} %`
)}
</Typography>
{ BigNumber(position && position.length >= 3 ? position[3] / 100 : 0).lt(50) && <Typography className={ `${classes.subValue} ${classes.greenText}` }>Safe</Typography> }
{ BigNumber(position && position.length >= 3 ? position[3] / 100 : 0).gt(80) && <Typography className={ `${classes.subValue} ${classes.redText}` }>Dangerous</Typography> }
{ BigNumber(position && position.length >= 3 ? position[3] / 100 : 0).gte(50) && BigNumber(position && position.length >= 3 ? position[3] / 100 : 0).lte(80) && <Typography className={ `${classes.subValue} ${classes.orangeText}` }>Risky</Typography> }
</Grid>
</Grid>
</div>
Expand Down
12 changes: 12 additions & 0 deletions components/ffMintOverview/ffOverview.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@
margin-right: 24px !important;
}

.greenText {
color: #49a766 !important;
}

.orangeText {
color: #ffc512 !important;
}

.redText {
color: #dc3545 !important;
}

@media screen and (max-width: 1200px) {
.container {
width: calc(100% - 0px);
Expand Down
2 changes: 1 addition & 1 deletion components/lendAllAssetRow/lendAllAssetRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function LendAllAssetRowDetails({ lendingAsset, lendingBorrow, lendingBorrowLimi

return (
<Paper elevation={0} square className={classes.assetActions}>
<div className={BigNumber(theLimitUsed).gt(100) ? classes.assetInfoError : classes.assetInfo}>
<div className={BigNumber(theLimitUsed).gt(80) ? classes.assetInfoError : BigNumber(theLimitUsed).gte(50) ? classes.assetInfoWarning : classes.assetInfo}>
<div className={classes.infoField}>
<Typography variant={'h5'}>
Borrow limit:
Expand Down
12 changes: 12 additions & 0 deletions components/lendAllAssetRow/lendAllAssetRow.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@
background: #dc3545;
}

.assetInfoWarning {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
padding: 36px;
width: 100%;
flex-wrap: wrap;
border-bottom: 1px solid rgba(128, 128, 128, 0.32);
background: #ffc512;
}

.removePadding {
padding: 0px 24px !important;
}
Expand Down
6 changes: 1 addition & 5 deletions components/lendBorrowAssetRow/lendBorrowAssetRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,7 @@ function LendBorrowAssetDetails({
return (
<Paper elevation={0} square className={classes.assetActions}>
<div
className={
BigNumber(theLimitUsed).gt(100)
? classes.assetInfoError
: classes.assetInfo
}
className={BigNumber(theLimitUsed).gt(80) ? classes.assetInfoError : BigNumber(theLimitUsed).gte(50) ? classes.assetInfoWarning : classes.assetInfo}
>
<div className={classes.infoField}>
<Typography variant={"h5"}>
Expand Down
12 changes: 12 additions & 0 deletions components/lendBorrowAssetRow/lendBorrowAssetRow.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@
background: #dc3545;
}

.assetInfoWarning {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
padding: 36px;
width: 100%;
flex-wrap: wrap;
border-bottom: 1px solid rgba(128, 128, 128, 0.32);
background: #ffc512;
}

@media screen and (max-width: 1000px) {
.lendingRow {
padding: 0px 6px;
Expand Down
8 changes: 1 addition & 7 deletions components/lendSupplyAssetRow/lendSupplyAssetRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,7 @@ function LendSupplyAssetDetails({

return (
<Paper elevation={0} square className={classes.assetActions}>
<div
className={
theLimitUsed === "infinite" || BigNumber(theLimitUsed).gt(100)
? classes.assetInfoError
: classes.assetInfo
}
>
<div className={ theLimitUsed === "infinite" || BigNumber(theLimitUsed).gt(80) ? classes.assetInfoError : BigNumber(theLimitUsed).gte(50) ? classes.assetInfoWarning : classes.assetInfo } >
<div className={classes.infoField}>
<Typography variant={"h5"}>
Borrow limit:
Expand Down
12 changes: 12 additions & 0 deletions components/lendSupplyAssetRow/lendSupplyAssetRow.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@
background: #dc3545;
}

.assetInfoWarning {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
padding: 36px;
width: 100%;
flex-wrap: wrap;
border-bottom: 1px solid rgba(128, 128, 128, 0.32);
background: #ffc512;
}


@media screen and (max-width: 1000px) {
.lendingRow {
Expand Down

0 comments on commit 0711db1

Please sign in to comment.