Also display round number at blocks for now. Probably good to go to a table style view soon

This commit is contained in:
Marco van Dijk 2022-05-08 16:22:25 +02:00
parent 2fb915fee4
commit 21268de56f
3 changed files with 15 additions and 2 deletions

View File

@ -7,6 +7,14 @@ const Block = (obj) => {
const thisLocalDate = dateObj.toLocaleString();
const thisOffset = (-dateObj.getTimezoneOffset() / 60);
let currentRoundString;
if (obj.currentRound) {
currentRoundString =
<p style={{ overflowWrap: 'break-word' }}>
Round {obj.currentRound}
</p>
}
return (
<div className="rowAlignLeft" style={{ margin: 0, marginTop: '1em', width: '100%' }}>
<a className="selectOrch" style={{ cursor: 'alias', margin: 0 }} target="_blank" rel="noopener noreferrer" href={obj.url}>
@ -15,6 +23,7 @@ const Block = (obj) => {
<a className="selectOrch" style={{ cursor: 'alias', margin: 0 }} target="_blank" rel="noopener noreferrer" href={"https://arbiscan.io/block/" + obj.block}>
<h3 style={{ padding: '0.2em', cursor: 'alias' }}>🔗</h3>
</a>
{currentRoundString}
<span className="rowAlignRight darkText mobileSmallerFont" style={{ margin: 0 }}>
<p style={{ overflowWrap: 'break-word' }}>
📅&nbsp;{thisLocalDate}

View File

@ -172,9 +172,11 @@ const EventButton = (obj) => {
}
}
let blockNumber;
if (obj.isFirstOfBlock) {
blockNumber = <Block block={obj.isFirstOfBlock} time={obj.time} url={"https://arbiscan.io/tx/" + obj.eventObj.transactionHash} />
console.log(obj);
blockNumber = <Block currentRound={obj.currentRound} block={obj.isFirstOfBlock} time={obj.time} url={"https://arbiscan.io/tx/" + obj.eventObj.transactionHash} />
}
return (

View File

@ -73,6 +73,7 @@ const EventViewer = (obj) => {
let transferTicketEventsIdx = obj.transferTicketEvents.length - 1;
let redeemTicketEventsIdx = obj.redeemTicketEvents.length - 1;
let roundsIdx = obj.rounds.length - 1;
let currentRound;
if (!filterActivated) {
filtered += activateEventsIdx + 1;
@ -222,7 +223,7 @@ const EventViewer = (obj) => {
if (thisObj.blockTime > latestTime) {
latestTime = thisObj.blockTime;
thisEvent = thisObj;
latestType = "round"
latestType = "round";
}
}
@ -455,6 +456,7 @@ const EventViewer = (obj) => {
eventObj={thisEvent}
type={latestType}
isFirstOfBlock={prevBlock}
currentRound={roundsIdx >= 0 ? obj.rounds[roundsIdx].number : null}
time={thisEvent.blockTime}
setSearchTerm={obj.setSearchTerm}
monthlyStats={obj.monthlyStats}