Skip to content

Commit

Permalink
feat: Pool Metrics component
Browse files Browse the repository at this point in the history
 - Rename section to "Pool Funds"
 - Change "Fund Available" to "Balance"
 - Change "Fund Pool" button to "Add funds"
 - Upgrade pool balance data styling
  • Loading branch information
Mati0x committed Aug 9, 2024
1 parent 85787f3 commit 3fc0c46
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions apps/web/components/PoolMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,20 @@ export const PoolMetrics: FC<PoolMetricsProps> = ({
<DisplayNumber number={amount} tokenSymbol={tokenGarden.symbol} />
</div>
</TransactionModal>
<section className="section-layout gap-8 flex flex-col">
<header>
<h2>Pool Metrics</h2>
</header>
<div className="flex justify-between">
<div className="flex flex-col gap-6">
<div className="flex gap-3 items-baseline">
<h5>Funds Available:</h5>
<p className="">
{formatTokenAmount(poolAmount, tokenGarden.decimals)}{" "}
{tokenGarden.symbol}
</p>
</div>
<div className="flex gap-3 items-baseline">
<h5>Spending Limit:</h5>
<p className="">
{`${(spendingLimitPct * MAX_RATIO_CONSTANT).toFixed(2)} %`}
</p>
</div>
<section className="section-layout gap-4 flex flex-col">
<h2>Pool Funds</h2>
<div className="flex justify-between items-center">
<div className="flex gap-3 items-baseline">
<h4>Balance:</h4>
<DisplayNumber
number={formatTokenAmount(poolAmount, tokenGarden.decimals)}
tokenSymbol={tokenGarden.symbol}
compact={true}
className="font-semibold text-primary-content text-2xl"
/>
</div>
<form
className="flex flex-col gap-4"
className="flex gap-2"
onSubmit={(e) => {
e.preventDefault();
handleFundPool();
Expand All @@ -147,7 +139,6 @@ export const PoolMetrics: FC<PoolMetricsProps> = ({
type="number"
placeholder="0"
required
className=""
step={INPUT_TOKEN_MIN_VALUE}
onChange={(e) => setAmount(e.target.value)}
value={amount}
Expand All @@ -164,8 +155,9 @@ export const PoolMetrics: FC<PoolMetricsProps> = ({
type="submit"
disabled={missmatchUrl || !accountAddress}
tooltip={tooltipMessage}
className="min-w-[200px]"
>
Fund pool
Add Funds
</Button>
</form>
</div>
Expand Down

0 comments on commit 3fc0c46

Please sign in to comment.