Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/views/addr.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default ({ t, addr, addrQR, addrTxs, goAddr, openTx, spends, tipHeight, l

<div className="load-more-container">
<div>
{ loading ? <div className="load-more g-btn font-btn-2 disabled"><span>{t`Loading...`}</span><div>{loader("big")}</div></div>
{ loading ? <div className="load-more g-btn font-btn-2 disabled"><span>{t`Loading...`}</span></div>
: pagingNav(addr, last_seen_txid, est_curr_chain_seen_count, prev_paging_txids, next_paging_txids, prev_paging_est_count, t) }
</div>
</div>
Expand Down
175 changes: 89 additions & 86 deletions client/src/views/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,111 +11,114 @@ const staticRoot = process.env.STATIC_ROOT || "";

export const blks = (blocks, viewMore, { t, ...S }) => (
<div className="block-container">
<div className="table-header">
<div className="table-header-icon-container">
<BlockIcon />
</div>
<h1 className="table-header-title">Latest Blocks</h1>
</div>
{!blocks ? (

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the load rendering check up here fixes a divergence with blockstream.info that was causing the unconditional render of the table, which moved the loading icon to the table's body

loader()
) : !blocks.length ? (
<p>{t`No recent blocks`}</p>
) : (
<div className="blocks-table">
{blocks &&
blocks.map((b, index) => (
<a className="blocks-table-link-row" href={`block/${b.id}`}>
<div
className={`blocks-table-card ${index === 0 ? "first-blocks-table-card" : ""} ${S.newBlockEntries && S.newBlockEntries[b.id] ? "new-table-entry" : ""}`}
>
<div className="block-icon-container">
<BlockIcon />
</div>
<div className="block-details">
<div className="block-card-header">
<div className="block-card-top-header">
<div className="mobile-block-icon-container">
<BlockIcon />
<div className="table-header">
<div className="table-header-icon-container">
<BlockIcon />
</div>
<h1 className="table-header-title">Latest Blocks</h1>
</div>
<div className="blocks-table-body">
{blocks &&
blocks.map((b, index) => (
<a className="blocks-table-link-row" href={`block/${b.id}`}>
<div
className={`blocks-table-card ${S.newBlockEntries && S.newBlockEntries[b.id] ? "new-table-entry" : ""}`}
>
<div className="block-icon-container">
<BlockIcon />
</div>
<div className="block-details">
<div className="block-card-header">
<div className="block-card-top-header">
<div className="mobile-block-icon-container">
<BlockIcon />
</div>
<p className="block-number">
#{b.height.toLocaleString()}
</p>
<div
className="table-copy-button code-button-btn"
role="button"
tabindex="0"
data-clipboardCopy={"" + b.height}
aria-label={`Copy block number ${b.height}`}
>
<CopyIcon />
</div>
{index === 0 ? (
<div className="latest-block-badge">Latest</div>
) : (
""
)}
</div>
<p className="block-number">
#{b.height.toLocaleString()}
</p>
<div
className="table-copy-button code-button-btn"
role="button"
tabindex="0"
data-clipboardCopy={"" + b.height}
aria-label={`Copy block number ${b.height}`}

<p
className="block-timestamp"
title={new Date(b.timestamp * 1000)}
>
<CopyIcon />
</div>
{index === 0 ? (
<div className="latest-block-badge">Latest</div>
) : (
""
)}
<ClockIcon className="block-timestamp-icon" />
{formatRelativeTime(b.timestamp)?.toUpperCase()}
</p>
</div>

<p
className="block-timestamp"
title={new Date(b.timestamp * 1000)}
>
<ClockIcon className="block-timestamp-icon" />
{formatRelativeTime(b.timestamp)?.toUpperCase()}
</p>
</div>
<div className="block-card-body">
<div className="block-stat">
<div className="block-stat-title">TRANSACTIONS</div>
<div className="block-stat-value">
{formatNumber(b.tx_count).toLocaleString()}
<div className="block-card-body">
<div className="block-stat">
<div className="block-stat-title">TRANSACTIONS</div>
<div className="block-stat-value">
{formatNumber(b.tx_count).toLocaleString()}
</div>
</div>
</div>
<div className="block-stat">
<div className="block-stat-title">SIZE</div>
<div className="block-stat-value">
{formatVMB(b.size, "MB")}
<div className="block-stat">
<div className="block-stat-title">SIZE</div>
<div className="block-stat-value">
{formatVMB(b.size, "MB")}
</div>
</div>
</div>
</div>

<div className="block-usage">
<div className="usage-and-tooltip">
<p className="usage-number">
{getBlockPercentageUsed(b.weight)}%
</p>
<div className="tooltip">
<img src={`${staticRoot}img/icons/tooltip.svg`} />
<div className="tooltip-dialogue">
How full this block is.
<div className="block-usage">
<div className="usage-and-tooltip">
<p className="usage-number">
{getBlockPercentageUsed(b.weight)}%
</p>
<div className="tooltip">
<img src={`${staticRoot}img/icons/tooltip.svg`} />
<div className="tooltip-dialogue">
How full this block is.
</div>
</div>
</div>
</div>
<div className="usage-bar">
<div
className="usage-bar-fill"
style={{
width: `${getBlockPercentageUsed(b.weight)}%`,
}}
></div>
<div className="usage-bar">
<div
className="usage-bar-fill"
style={{
width: `${getBlockPercentageUsed(b.weight)}%`,
}}
></div>
</div>
</div>
</div>
</div>
</div>
</a>
))}
</div>
)}
{blocks && viewMore ? (
<a className="view-more font-link-semibold" href="blocks/recent">
<span>{t`See more`}</span>
<div>
<img alt="" src={`${staticRoot}img/icons/arrow-right-blue.svg`} />
</a>
))}
</div>
</a>
) : (
""

{blocks && viewMore ? (
<a className="view-more font-link-semibold" href="blocks/recent">
<span>{t`See more`}</span>
<div>
<img alt="" src={`${staticRoot}img/icons/arrow-right-blue.svg`} />
</div>
</a>
) : (
""
)}
</div>
)}
</div>
);
51 changes: 26 additions & 25 deletions client/src/views/network-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ const staticRoot = process.env.STATIC_ROOT || "";
const siteRoot = process.env.BASE_PREFIX || "";
const withRoot = (url) => (siteRoot && url && url.charAt(0) === "/" ? siteRoot + url : url);
const itemEntries = items ? Object.entries(items) : [];
const networkId = name => name.replace(/ /g, "");
const networkIconSrc = name => `${staticRoot}img/icons/${networkId(name)}-menu-logo.svg`;
const activeName = active || (itemEntries[0] && itemEntries[0][0]);
const activeId = activeName && activeName.replace(/ /g, "");
const activeId = activeName && networkId(activeName);

export default ({ t, page }) => (
<div className="main-nav-container">
Expand All @@ -25,10 +27,10 @@ export default ({ t, page }) => (
<img
className="menu-logo"
alt=""
src={`${staticRoot}img/icons/${activeId}-menu-logo.svg`}
src={networkIconSrc(activeName)}
/>
</span>
<span>{t(activeName)}</span>
<span className="network-name">{t(activeName)}</span>
<svg
className="network-angle-down"
width="17"
Expand All @@ -44,28 +46,27 @@ export default ({ t, page }) => (
<div className="network-hover-menu-container">
<div className="network-hover-menu">
{itemEntries.map(([name, url]) => {
return (
<a
id={name.replace(/ /g, "")}
href={withRoot(url)}
className={`network-hover-menu-option-container ${name.replace(/ /g, "").toLowerCase()} ${name === activeName ? "active" : ""}`}
rel="external"
>
<div
id={name.replace(/ /g, "")}
className={`network-hover-menu-option`}
>
<span>
<img
className="menu-logo"
src={`${staticRoot}img/icons/${name.replace(/ /g, "")}-menu-logo.svg`}
/>
</span>
{t(name)}
</div>
</a>
);
})}
const id = networkId(name);

return (
<a
id={id}
href={withRoot(url)}
className={`network-hover-menu-option-container ${id.toLowerCase()} ${name === activeName ? "active" : ""}`}
Comment thread
FedOken marked this conversation as resolved.
rel="external"
>
<div className="network-hover-menu-option">
<span>
<img
className="menu-logo"
src={networkIconSrc(name)}
/>
</span>
{t(name)}
</div>
</a>
);
})}
</div>
</div>
</li>
Expand Down
3 changes: 2 additions & 1 deletion flavors/bitcoin-testnet/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
text-align: center;
font-size: 14px;
line-height: 2.4;
left: 0px;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the left: 0px as a small fix for the misaligned banner in test networks.

Before:

Image

After:

Image

}

.sub-nav-container{
margin-top: 25px;
margin-top: 40px;
}
3 changes: 2 additions & 1 deletion flavors/bitcoin-testnet4/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
text-align: center;
font-size: 14px;
line-height: 2.4;
left: 0px;
}

.sub-nav-container{
margin-top: 25px;
margin-top: 40px;
}

.block-header-title, .transaction-header-title{
Expand Down
8 changes: 4 additions & 4 deletions flavors/liquid-mainnet/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
bottom: 0;
left: 0;
right: 0;
background: #46beae;
background: var(--accent-color);
height: 3px;
border-radius: 10px;
}

.details-btn > div {
color: #46beae;
border: 1px solid #46beae;
color: var(--accent-color);
border: 1px solid var(--accent-color);
background: none;
}

.transaction-box > .footer > div:nth-child(3) {
color: #46beae;
color: var(--accent-color);
}

.navbar {
Expand Down
3 changes: 2 additions & 1 deletion flavors/liquid-testnet/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
text-align: center;
font-size: 14px;
line-height: 2.4;
left: 0px;
}

.sub-nav-container{
margin-top: 25px;
margin-top: 40px;
}

.block-header-title:after, .transaction-header-title:after, .asset-page h1:after {
Expand Down
Loading