From 5682b82ac464f48e3810720ec353b758cce95364 Mon Sep 17 00:00:00 2001 From: Randall Naar Date: Tue, 14 Jul 2026 15:57:54 -0400 Subject: [PATCH] Updated address page. --- client/src/components/block-details-card.js | 11 +- client/src/components/icons.js | 5 + client/src/views/addr.js | 393 +++++++++++++------- client/src/views/block.js | 11 +- client/src/views/blocks.js | 16 +- client/src/views/tx.js | 29 +- www/style.css | 159 ++++---- 7 files changed, 362 insertions(+), 262 deletions(-) diff --git a/client/src/components/block-details-card.js b/client/src/components/block-details-card.js index af2a6671..e7e08a4b 100644 --- a/client/src/components/block-details-card.js +++ b/client/src/components/block-details-card.js @@ -19,13 +19,14 @@ const BlockDetailsCard = ({ block, statusText, statusVariant = "success", + t, }) => { const percentage = block ? Math.min(Math.max(getBlockPercentageUsed(block.weight), 0), 100) : 0; return ( - +
@@ -59,15 +60,15 @@ const BlockDetailsCard = ({
- +
); }; diff --git a/client/src/components/icons.js b/client/src/components/icons.js index 2589c034..7eea2bb7 100644 --- a/client/src/components/icons.js +++ b/client/src/components/icons.js @@ -8,6 +8,11 @@ export const TxArrowsIcon = ({ className } = {}) => +export const AddressHamburgerIcon = ({ className } = {}) => + + export const ArrowsInSimpleIcon = ({ className } = {}) =>
-
-
-
-

{t`Address`}

-
- {display_addr} - { process.browser &&
-
-
} +
+
+
+
+ +
+

{t`Address`}

+
+
+ {show_qr && ( +
+ +
+ )} +
+

{display_addr}

+ +
+
+ + + + +
- {show_qr &&
- -
} -
-
-
, -
-
- { is_confidential && [ -
-
{ t`Confidential` }
-
{ goAddr.confidential_addr }
-
- ,
-
{ t`Unconfidential` }
-
{ goAddr.addr }
- ] } - - { (mempool_stats.tx_count > 0 || chain_stats.tx_count == 0) &&
-
{t`Total tx count`}
-
{total_txs}
-
} - - { chain_stats.tx_count > 0 &&
-
{t`Confirmed tx count`}
-
{formatNumber(chain_stats.tx_count)}
-
} - { chain_stats.funded_txo_count > 0 &&
-
{t`Confirmed received`}
-
{fmtTxos(chain_stats.funded_txo_count, chain_stats.funded_txo_sum, t)}
-
} - { chain_stats.spent_txo_count > 0 &&
-
{t`Confirmed spent`}
-
{fmtTxos(chain_stats.spent_txo_count, chain_stats.spent_txo_sum, t)}
-
} - { chain_stats.tx_count > 0 &&
-
{t`Confirmed unspent`}
-
{fmtTxos(chain_utxo_count, chain_utxo_sum, t)}
-
} - - { mempool_stats.tx_count > 0 &&
-
{t`Unconfirmed tx count`}
-
{formatNumber(mempool_stats.tx_count)}
-
} - { mempool_stats.funded_txo_count > 0 &&
-
{t`Unconfirmed received`}
-
{fmtTxos(mempool_stats.funded_txo_count, mempool_stats.funded_txo_sum, t)}
-
} - { mempool_stats.spent_txo_count > 0 &&
-
{t`Unconfirmed spent`}
-
{fmtTxos(mempool_stats.spent_txo_count, mempool_stats.spent_txo_sum, t)}
-
} - - { (mempool_stats.tx_count > 0 || chain_stats.tx_count == 0) &&
-
{t`Total unspent`}
-
{fmtTxos(total_utxo_count, total_utxo_sum, t)}
-
} + + {show_qr && ( +
+ +
+ )}
-
-
-

{txsShownText(total_txs, est_prev_total_seen_count, shown_txs, t)}

- { addrTxs ? addrTxs.map(tx => txBox(tx, { openTx, tipHeight, t, spends, addr, ...S })) - : loader() } -
+
+
+
+
+

{t`Unconfirmed tx count`}

+
+

{formatNumber(mempool_stats.tx_count)}

+
+
-
-
- { loading ?
{t`Loading...`}
- : pagingNav(addr, last_seen_txid, est_curr_chain_seen_count, prev_paging_txids, next_paging_txids, prev_paging_est_count, t) } +
+

{t`Unconfirmed received`}

+
+ {fmtTxos( + mempool_stats.funded_txo_count, + mempool_stats.funded_txo_sum, + t, + )} +
+
+
+ +
+
+

{t`Unconfirmed spent`}

+
+ {fmtTxos( + mempool_stats.spent_txo_count, + mempool_stats.spent_txo_sum, + t, + )} +
+
+ +
+

{t`Total unspent`}

+
+ {fmtTxos(total_utxo_count, total_utxo_sum, t)} +
+
+
+
+ {addrTxs + ? addrTxs.map((tx, index) => + txBox(tx, { + openTx, + tipHeight, + t, + spends, + listingIndex: est_prev_total_seen_count + index + 1, + listingTotal: total_txs, + addr, + ...S + }), + ) + : loader()}
-
- ] - , { t, ...S }) -} -const fmtTxos = (count, sum, t) => - (count > 0 ? t`${formatNumber(count)} outputs` : t`No outputs`) -+ (sum > 0 ? ` (${formatSat(sum)})` : '') +
+
+ {loading ? ( +
+ {t`Loading...`} +
+ ) : ( + pagingNav( + addr, + display_addr, + last_seen_txid, + est_curr_chain_seen_count, + prev_paging_txids, + next_paging_txids, + prev_paging_est_count, + t, + ) + )} +
+
+
, + ], + { t, ...S }, + ); +}; -const txsShownText = (total, start, shown, t) => - (total > perPage && shown > 0) - ? t`${ start > 0 ? `${start}-${+start+shown}` : shown} of ${formatNumber(total)} Transactions` - : t`${total} Transactions` +const fmtTxos = (count, sum, t) => { + const outputs = + count > 0 ? t`${formatNumber(count)} outputs` : t`No outputs`; -const pagingNav = (addr, last_seen_txid, est_curr_chain_seen_count, prev_paging_txids, next_paging_txids, prev_paging_est_count, t) => - process.browser + if (!Number.isFinite(sum)) return outputs; + + return count > 0 ? `${formatSat(sum)} (${outputs})` : outputs; +}; -? last_seen_txid != null && -
- {t`Load more`} -
- -: [ - prev_paging_txids != null && - -
- {t`Newer`} -
- , next_paging_txids != null && - - {t`Older`} -
-
- ] +const pagingNav = ( + addr, + display_addr, + last_seen_txid, + est_curr_chain_seen_count, + prev_paging_txids, + next_paging_txids, + prev_paging_est_count, + t, +) => + process.browser + ? last_seen_txid != null && ( +
+ {t`Load more`} +
+ ) + : [ + prev_paging_txids != null && ( + +
+ +
+ {t`Newer`} +
+ ), + next_paging_txids != null && ( + + {t`Older`} +
+ +
+
+ ), + ]; diff --git a/client/src/views/block.js b/client/src/views/block.js index 374081a5..84de3bd6 100644 --- a/client/src/views/block.js +++ b/client/src/views/block.js @@ -36,7 +36,7 @@ export default ({ b && layout( [ -
+
@@ -65,6 +65,7 @@ export default ({
-

VERSION

+

{t`Version`}

{formatHex(b.version)}

@@ -98,7 +99,7 @@ export default ({
-

MERKLE ROOT

+

{t`Merkle root`}

{b.merkle_root}

@@ -106,13 +107,13 @@ export default ({

- {process.env.IS_ELEMENTS ? "BLOCK SIGNATURES" : "NONCE"} + {process.env.IS_ELEMENTS ? "BLOCK SIGNATURES" : t`Nonce`}

{process.env.IS_ELEMENTS ? ( ) : ( -

{b.nonce}

+

{formatHex(b.nonce)}

)}
diff --git a/client/src/views/blocks.js b/client/src/views/blocks.js index 42f7f2e6..4c692d4b 100644 --- a/client/src/views/blocks.js +++ b/client/src/views/blocks.js @@ -28,10 +28,15 @@ export const blks = (blocks, viewMore, { t, ...S }) => (
{blocks && blocks.map((b, index) => ( - +
+
@@ -44,15 +49,14 @@ export const blks = (blocks, viewMore, { t, ...S }) => (

#{b.height.toLocaleString()}

-
-
+ {index === 0 ? (
Latest
) : ( @@ -97,7 +101,7 @@ export const blks = (blocks, viewMore, { t, ...S }) => (
- +
))}
diff --git a/client/src/views/tx.js b/client/src/views/tx.js index 44090a17..c54e2f2b 100644 --- a/client/src/views/tx.js +++ b/client/src/views/tx.js @@ -61,14 +61,12 @@ export default ({ return layout( [ -
+
{txHeader(tx, { t, tipHeight, ...S })} - {unblinded && unblinded.error ? ( + {unblinded && unblinded.error && (
{t`Warning:`} {unblinded.error.toString()}
- ) : ( -
)} {txBox(tx, { openTx, @@ -91,6 +89,7 @@ export default ({
@@ -145,19 +144,18 @@ export const txBox = ( ) : null}
{showTxId ? ( -
- + ) : ( "" @@ -253,17 +251,16 @@ const txHeader = (

Transaction Details

-
-

{tx.txid}

-
+

{tx.txid}

+
+ {!isConfirmed ? (