From 29f40268e0a53e810ccec35ccc76588c424a44bb Mon Sep 17 00:00:00 2001 From: chaojun Date: Tue, 3 Dec 2024 16:06:12 +0800 Subject: [PATCH 1/2] Update polkadot tab total value, #1401 --- .../components/overview/content/summary.jsx | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/landing/src/components/overview/content/summary.jsx b/landing/src/components/overview/content/summary.jsx index f3bf6c058..5d4d8b3da 100644 --- a/landing/src/components/overview/content/summary.jsx +++ b/landing/src/components/overview/content/summary.jsx @@ -48,25 +48,31 @@ export default function OverviewSummary({ chain = "" }) {
- } - content={ - chain === "polkadot" ? ( - } + content={ + - ) : ( + } + /> + ) : ( + } + content={ - ) - } - /> + } + /> + )} } /> -
- - +
+
{abbreviateBigNumber(amount)}
+
{symbol}
+
{!!amount && "≈ "}${abbreviateBigNumber(amount * symbolPrice)}
@@ -160,11 +167,10 @@ function SummaryItemValueContent({ amount = 0, symbol = "", symbolPrice = 0 }) { ); } -function SummaryItemTokenAmount({ amount = 0, symbol = "" }) { +function PolkadotSummaryItemContent({ fiatValue = 0 }) { return (
-
{abbreviateBigNumber(amount)}
-
{symbol}
+
≈ ${abbreviateBigNumber(fiatValue)}
); } From 5ed398288cd8e1e616e5e5a04803355ca0d2fda1 Mon Sep 17 00:00:00 2001 From: chaojun Date: Tue, 3 Dec 2024 16:12:17 +0800 Subject: [PATCH 2/2] refactor, #1401 --- .../components/overview/content/summary.jsx | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/landing/src/components/overview/content/summary.jsx b/landing/src/components/overview/content/summary.jsx index 5d4d8b3da..76c9769a6 100644 --- a/landing/src/components/overview/content/summary.jsx +++ b/landing/src/components/overview/content/summary.jsx @@ -49,28 +49,12 @@ export default function OverviewSummary({ chain = "" }) {
{chain === "polkadot" ? ( - } - content={ - - } - /> + ) : ( - } - content={ - - } + )} } + content={ + + } + /> + ); +} + function SummaryItemValueContent({ amount = 0, symbol = "", symbolPrice = 0 }) { return (
@@ -167,10 +168,17 @@ function SummaryItemValueContent({ amount = 0, symbol = "", symbolPrice = 0 }) { ); } -function PolkadotSummaryItemContent({ fiatValue = 0 }) { +function SummaryItemTotal({ fiatValue = 0 }) { return ( -
-
≈ ${abbreviateBigNumber(fiatValue)}
-
+ } + content={ +
+
≈ ${abbreviateBigNumber(fiatValue)}
+
+ } + /> ); }