Minor UI fixes

This commit is contained in:
Vivek Teega 2020-06-24 20:22:10 +05:30
parent 4fd621b999
commit 7e53fcd69a

View File

@ -169,6 +169,7 @@
return page; return page;
}, },
blockPage(obj) { blockPage(obj) {
debugger;
let { let {
blockHeight, blockHeight,
size, size,
@ -176,11 +177,11 @@
reward, reward,
hash, hash,
difficulty, difficulty,
nonce, nonce
} = obj, } = obj,
page = document.createElement("div"), page = document.createElement("div"),
wordForm = "transaction"; wordForm = "transaction";
if (transactions > 1) wordForm = "transactions"; if (transactions.length > 1) wordForm = "transactions";
page.classList.add("page"); page.classList.add("page");
page.id = "block_page"; page.id = "block_page";
@ -188,11 +189,13 @@
<h5 class="label">Block Height</h5> <h5 class="label">Block Height</h5>
<h2 class="block-height">${blockHeight}</h2> <h2 class="block-height">${blockHeight}</h2>
<div class="card"> <div class="card">
<h4>1 ${wordForm}</h4> <h5 class="label">Relavant Transactions</h5>
<h5 class="label">${size}</h5> <h4>${transactions.length}</h4>
<h5 class="label">Confirmations</h5>
<h4>${size}</h4>
<h5 class="label">Reward</h5> <h5 class="label">Reward</h5>
<h4>${reward}</h4> <h4>${reward}</h4>
<h5 class="label">Transaction ID</h5> <h5 class="label">Block Hash</h5>
<h4 class="breakable">${hash}</h4> <h4 class="breakable">${hash}</h4>
<h5 class="label">Difficulty</h5> <h5 class="label">Difficulty</h5>
<h4>${difficulty}</h4> <h4>${difficulty}</h4>
@ -334,8 +337,8 @@
<h4 class="breakable">${incAddress}</h4> <h4 class="breakable">${incAddress}</h4>
</div> </div>
<div class="tabs"> <div class="tabs">
<h4 class="tab active" data-rank="1" data-target="token_balance_container">Top Balances</h4> <h4 class="tab active" data-rank="1" data-target="token_balance_container">Recent Balances</h4>
<h4 class="tab" data-rank="2" data-target="token_transaction_container">Top Transactions</h4> <h4 class="tab" data-rank="2" data-target="token_transaction_container">Recent Transactions</h4>
<div class="line"></div> <div class="line"></div>
</div> </div>
<ul id="token_balance_container" data-tab-group="token" class="card"></ul> <ul id="token_balance_container" data-tab-group="token" class="card"></ul>
@ -778,6 +781,7 @@
if (pageId === "block_page") { if (pageId === "block_page") {
let [blockInfo, blockTransactions] = await Promise.all([getBlockInfo(field), getBlockTransactions(field)]) let [blockInfo, blockTransactions] = await Promise.all([getBlockInfo(field), getBlockTransactions(field)])
debugger
pageContainer.append(create.blockPage(blockInfo)); pageContainer.append(create.blockPage(blockInfo));
pageTitle.textContent = "block"; pageTitle.textContent = "block";
loading() loading()
@ -1374,11 +1378,11 @@
async function getBlockInfo(thisBlock) { async function getBlockInfo(thisBlock) {
const response = await fetch(`${tokenapiUrl}/api/v1.0/getBlockDetails/${thisBlock}`), const response = await fetch(`${tokenapiUrl}/api/v1.0/getBlockDetails/${thisBlock}`),
info = await response.json(), info = await response.json(),
{ height, size, reward, hash, difficulty, nonce } = info.blockDetails { height, size, reward, hash, difficulty, nonce, tx } = info.blockDetails
return { return {
blockHeight: height, blockHeight: height,
size: size, size: size,
transactions: "", transactions: tx,
reward: reward, reward: reward,
hash: hash, hash: hash,
difficulty: difficulty, difficulty: difficulty,