From 855a4a53e2c05a611f0eeedabbdc4f6852d603ea Mon Sep 17 00:00:00 2001 From: ChainEx <57598532+AniketSindhu@users.noreply.github.com> Date: Thu, 8 Feb 2024 19:59:31 +0530 Subject: [PATCH] FEAT: UI improvements --- src/components/EmptyVault.tsx | 34 +++++++++++++++----------------- src/components/Params.tsx | 21 ++++++++++---------- src/components/StabilityPool.tsx | 21 ++++++++++---------- src/components/Vault.tsx | 16 +++++++-------- src/components/modals/Modal.tsx | 10 +++++----- tailwind.config.js | 2 +- 6 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/components/EmptyVault.tsx b/src/components/EmptyVault.tsx index c9670e9..df8c278 100644 --- a/src/components/EmptyVault.tsx +++ b/src/components/EmptyVault.tsx @@ -1,29 +1,27 @@ import React from "react"; +import Button from "./Button"; const EmptyVault = ({ openModal }: { openModal: Function }) => { return ( -
-
-

Vault

+
+
+

Vault

-

- You haven't borrowed any pUSD yet. -

+

You haven't borrowed any pUSD yet.

-

- You can borrow pUSD by opening a Vault. -

+

You can borrow pUSD by opening a Vault.

- +
+ +
); diff --git a/src/components/Params.tsx b/src/components/Params.tsx index 0f44e71..d6b4ca6 100644 --- a/src/components/Params.tsx +++ b/src/components/Params.tsx @@ -19,40 +19,41 @@ const Params = ({ pUSDInStabilityPool }: ParamsProps) => { return ( -
-

Neper statistics

+
+

Neper statistics

-

Protocol

  • Current MCR - {mcr}% + {mcr}%
  • Total Collateral Ratio - + {((parseFloat(totalColl) * 41000 * 100) / parseFloat(totalDebt)).toFixed(2)}%
  • Total Collateral - {totalColl} WBTC + {totalColl} WBTC
  • Total Debt - {totalDebt} pUSD + {totalDebt} pUSD
  • Borrowing Fee - {(parseFloat(baseRate) + 0.5).toFixed(3)} % + + {(parseFloat(baseRate) + 0.5).toFixed(3)} % +
  • Vaults - {vaultCount} + {vaultCount}
  • pUSD in Stability Pool - + {pUSDInStabilityPool} pUSD ( {BigNumber(pUSDInStabilityPool) .dividedBy(BigNumber(totalDebt)) diff --git a/src/components/StabilityPool.tsx b/src/components/StabilityPool.tsx index 4a962ee..edcd1f5 100644 --- a/src/components/StabilityPool.tsx +++ b/src/components/StabilityPool.tsx @@ -22,9 +22,8 @@ const StabilityPool = ({}) => { const { setLoader } = useActions(); - const { depositStablityPool, withdrawStabilityPool, fetchAllData, - stabilityPool - } = useAppContext(); + const { depositStablityPool, withdrawStabilityPool, fetchAllData, stabilityPool } = + useAppContext(); const onStake = async () => { try { @@ -62,18 +61,18 @@ const StabilityPool = ({}) => { return (
    { -
    -
    -

    Stability Pool

    +
    +
    +

    Stability Pool

    -
    Unclaimed WBTC
    -
    {stabilityPool.reward_amount} WBTC
    +
    Unclaimed WBTC
    +
    {stabilityPool.reward_amount} WBTC
    -
    pUSD Staked
    -
    {stabilityPool.stake_amount} pUSD
    +
    pUSD Staked
    +
    {stabilityPool.stake_amount} pUSD
    @@ -105,7 +104,7 @@ const StabilityPool = ({}) => { placeholder="pUSD amount" error={withdrawError} value={withdrawInput} - onClose={() => setWithdrawCollateralModalOpen(false)} + onClose={() => setWithdrawModalOpen(false)} onSubmit={onWithdraw} onChange={v => setWithdrawInput(v)} /> diff --git a/src/components/Vault.tsx b/src/components/Vault.tsx index d2304a6..0b98c1e 100644 --- a/src/components/Vault.tsx +++ b/src/components/Vault.tsx @@ -119,25 +119,25 @@ const Vault = ({ isVault = false, id, coll, debt, collRatio, liquidationAt }: Va {!isVault ? ( ) : ( -
    -
    -

    Vault

    +
    +
    +

    Vault

    -
    +
    -
    Collateral Ratio
    +
    Collateral Ratio
    {collRatio} %
    -
    Collateral Value
    +
    Collateral Value
    {coll} WBTC
    -
    Debt
    +
    Debt
    {debt} pUSD
    -
    Liquidation at
    +
    Liquidation at
    $ {liquidationAt}
    diff --git a/src/components/modals/Modal.tsx b/src/components/modals/Modal.tsx index 23a2c95..5b84210 100644 --- a/src/components/modals/Modal.tsx +++ b/src/components/modals/Modal.tsx @@ -30,14 +30,14 @@ const Modal = ({ if (!show) return null; return ( -
    -
    +
    +
    -

    {heading}

    +

    {heading}

    -