From 7e53fcd69a66b2028086514c95b9c66b7bb2d726 Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Wed, 24 Jun 2020 20:22:10 +0530 Subject: [PATCH] Minor UI fixes --- index.html | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index eb954d7..3d788a1 100644 --- a/index.html +++ b/index.html @@ -169,6 +169,7 @@ return page; }, blockPage(obj) { + debugger; let { blockHeight, size, @@ -176,23 +177,25 @@ reward, hash, difficulty, - nonce, + nonce } = obj, page = document.createElement("div"), wordForm = "transaction"; - if (transactions > 1) wordForm = "transactions"; + if (transactions.length > 1) wordForm = "transactions"; page.classList.add("page"); page.id = "block_page"; page.innerHTML = `
Block Height

${blockHeight}

-
-

1 ${wordForm}

-
${size}
+
+
Relavant Transactions
+

${transactions.length}

+
Confirmations
+

${size}

Reward

${reward}

-
Transaction ID
+
Block Hash

${hash}

Difficulty

${difficulty}

@@ -334,8 +337,8 @@

${incAddress}

-

Top Balances

-

Top Transactions

+

Recent Balances

+

Recent Transactions

@@ -778,6 +781,7 @@ if (pageId === "block_page") { let [blockInfo, blockTransactions] = await Promise.all([getBlockInfo(field), getBlockTransactions(field)]) + debugger pageContainer.append(create.blockPage(blockInfo)); pageTitle.textContent = "block"; loading() @@ -1374,11 +1378,11 @@ async function getBlockInfo(thisBlock) { const response = await fetch(`${tokenapiUrl}/api/v1.0/getBlockDetails/${thisBlock}`), info = await response.json(), - { height, size, reward, hash, difficulty, nonce } = info.blockDetails + { height, size, reward, hash, difficulty, nonce, tx } = info.blockDetails return { blockHeight: height, size: size, - transactions: "", + transactions: tx, reward: reward, hash: hash, difficulty: difficulty,