Skip to content

Commit

Permalink
fix breakdown table
Browse files Browse the repository at this point in the history
  • Loading branch information
0xshiba1 committed Jul 12, 2024
1 parent a6bd5a7 commit 4baf8dc
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions frontend/src/components/dashboard/account/AccountBreakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface BreakdownColumn {
title: string;
titleTooltip?: string | ReactNode;
data: string[];
isSymbol?: boolean;
}

interface BreakdownColumnProps {
Expand All @@ -51,7 +52,7 @@ function BreakdownColumn({
isFirst,
isLast,
}: BreakdownColumnProps) {
return column.data.length === 0 ? (
return column.isSymbol ? (
<LabelWithTooltip
className={cn(
"h-fit w-auto flex-1 py-2 text-center",
Expand Down Expand Up @@ -178,13 +179,13 @@ export default function AccountBreakdown() {
`${formatToken(b.borrowedAmount, { exact: false })} ${b.reserve.symbol}`,
),
},
{ title: "×", data: [] },
{ title: "×", data: [], isSymbol: true },
{
title: "Price",
titleTooltip: WEIGHTED_BORROWS_PRICE_TOOLTIP,
data: sortedBorrows.map((b) => formatPrice(b.reserve.maxPrice)),
},
{ title: "×", data: [] },
{ title: "×", data: [], isSymbol: true },
{
title: "BW",
titleTooltip: BORROW_WEIGHT_TOOLTIP,
Expand All @@ -194,7 +195,7 @@ export default function AccountBreakdown() {
),
),
},
{ title: "=", data: [] },
{ title: "=", data: [], isSymbol: true },
{
title: "Total",
data: sortedBorrows.map((b) =>
Expand Down Expand Up @@ -235,23 +236,23 @@ export default function AccountBreakdown() {
`${formatToken(d.depositedAmount, { exact: false })} ${d.reserve.symbol}`,
),
},
{ title: "×", data: [] },
{ title: "×", data: [], isSymbol: true },
{
title: "Price",
titleTooltip: BORROW_LIMIT_PRICE_TOOLTIP,
data: sortedDeposits.map((d) =>
formatPrice(d.reserve.minPrice),
),
},
{ title: "×", data: [] },
{ title: "×", data: [], isSymbol: true },
{
title: "Open LTV",
titleTooltip: OPEN_LTV_TOOLTIP,
data: sortedDeposits.map((d) =>
formatLtvPercent(new BigNumber(d.reserve.config.openLtvPct)),
),
},
{ title: "=", data: [] },
{ title: "=", data: [], isSymbol: true },
{
title: "Total",
data: sortedDeposits.map((d) =>
Expand Down Expand Up @@ -290,20 +291,20 @@ export default function AccountBreakdown() {
`${formatToken(d.depositedAmount, { exact: false })} ${d.reserve.symbol}`,
),
},
{ title: "×", data: [] },
{ title: "×", data: [], isSymbol: true },
{
title: "Price",
data: sortedDeposits.map((d) => formatPrice(d.reserve.price)),
},
{ title: "×", data: [] },
{ title: "×", data: [], isSymbol: true },
{
title: "Close LTV",
titleTooltip: CLOSE_LTV_TOOLTIP,
data: sortedDeposits.map((d) =>
formatLtvPercent(new BigNumber(d.reserve.config.closeLtvPct)),
),
},
{ title: "=", data: [] },
{ title: "=", data: [], isSymbol: true },
{
title: "Total",
data: sortedDeposits.map((d) =>
Expand Down

0 comments on commit 4baf8dc

Please sign in to comment.