From c3547c368a7912d25d97bb5297bba6ae79417872 Mon Sep 17 00:00:00 2001
From: Peiman <25097709+Rickk137@users.noreply.github.com>
Date: Thu, 30 May 2024 13:09:08 +0330
Subject: [PATCH] feat: change debt to pnl (#288)
---
.../ui/src/components/Manage/ManageStats.tsx | 25 ++++++++++++++-----
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/liquidity/ui/src/components/Manage/ManageStats.tsx b/liquidity/ui/src/components/Manage/ManageStats.tsx
index 2f88c92ba..265ad56dd 100644
--- a/liquidity/ui/src/components/Manage/ManageStats.tsx
+++ b/liquidity/ui/src/components/Manage/ManageStats.tsx
@@ -22,7 +22,8 @@ const ChangeStat: FC<{
hasChanges: boolean;
dataTestId?: string;
formatFn: (val: Wei) => string;
-}> = ({ formatFn, value, newValue, hasChanges, dataTestId }) => {
+ withColor?: boolean;
+}> = ({ formatFn, value, newValue, hasChanges, dataTestId, withColor }) => {
return (
- {formatFn(value)}
+
+ {formatFn(value)}
+
{hasChanges && !value.eq(newValue) ? (
<>
- {formatFn(newValue)}
+
+ {formatFn(newValue)}
+
>
) : null}
@@ -181,7 +193,7 @@ export const ManageStatsUi: FC<{
- DEBT
+ PnL
@@ -192,8 +204,8 @@ export const ManageStatsUi: FC<{
{liquidityPosition && collateralType ? (
currency(val, {
currency: 'USD',
@@ -201,6 +213,7 @@ export const ManageStatsUi: FC<{
maximumFractionDigits: 8,
})
}
+ withColor
hasChanges={hasChanges}
dataTestId="manage-stats-debt-value"
/>