Skip to content

Commit

Permalink
(fix) Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rrw-zilliqa committed Nov 22, 2024
1 parent f5cd64b commit bec7caf
Showing 1 changed file with 45 additions and 42 deletions.
87 changes: 45 additions & 42 deletions src/execution/ChainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import ChainInfoItem from "../components/ChainInfoItem";
import ContentFrame from "../components/ContentFrame";
import { PendingChainInfoResults } from "../search/PendingResults";
import { useBCInfoStateInfo, useLatestBlockChainInfo } from "../useLatestBlock";
import { RuntimeContext } from "../useRuntime";
import { useQuirks } from "../useQuirks";
import { RuntimeContext } from "../useRuntime";

const ChainInfo: FC = () => {
const { zilliqa, provider } = useContext(RuntimeContext);
Expand All @@ -17,20 +17,20 @@ const ChainInfo: FC = () => {

const BCInfo = useBCInfoStateInfo(latestBlockChainInfo);

let gridValues = "grid-rows-2 grid-cols-4"
let gridValues = "grid-rows-2 grid-cols-4";
if (quirks?.isZilliqa1) {
gridValues = "grid-rows-3 grid-cols-4"
gridValues = "grid-rows-3 grid-cols-4";
}
gridValues = "grid items-baseline gap-x-1 border-t border-b border-gray-200 bg-gray-100 text-sm " + gridValues;
gridValues =
"grid items-baseline gap-x-1 border-t border-b border-gray-200 bg-gray-100 text-sm " +
gridValues;
// Return a table with rows containing the basic information of the most recent RECENT_SIZE blocks
return (
<ContentFrame isLoading={latestBlockChainInfo === undefined}>
<div className="pb-3">
<ChainInfoHeader isLoading={latestBlockChainInfo === undefined} />
{latestBlockChainInfo ? (
<div
className={ gridValues }
>
<div className={gridValues}>
<span>
<ChainInfoItem
title="Current Tx Epoch:"
Expand All @@ -43,35 +43,38 @@ const ChainInfo: FC = () => {
data={latestBlockChainInfo.NumTransactions}
/>
</span>
{ quirks?.isZilliqa1 && (<span>
<ChainInfoItem
title="Peers:"
data={latestBlockChainInfo.NumPeers}
/>
</span>) }
{ quirks?.isZilliqa1 && (<span>
<ChainInfoItem
title="Sharding Structure:"
data={`[${latestBlockChainInfo.ShardingStructure.NumPeers.toString()}]`}
/>
</span>)
}
{ quirks?.isZilliqa1 && (
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="Current DS Epoch:"
data={latestBlockChainInfo.CurrentDSEpoch}
title="Peers:"
data={latestBlockChainInfo.NumPeers}
/>
</span>
</span>
)}
{ quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="DS Block Rate:"
data={latestBlockChainInfo.DSBlockRate.toFixed(5)}
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="Sharding Structure:"
data={`[${latestBlockChainInfo.ShardingStructure.NumPeers.toString()}]`}
/>
</span>
)}
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="Current DS Epoch:"
data={latestBlockChainInfo.CurrentDSEpoch}
/>
</span>)
}
</span>
)}
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="DS Block Rate:"
data={latestBlockChainInfo.DSBlockRate.toFixed(5)}
/>
</span>
)}
<span>
<ChainInfoItem
title="Tx Block Rate:"
Expand All @@ -84,22 +87,22 @@ const ChainInfo: FC = () => {
data={latestBlockChainInfo.TransactionRate.toFixed(5)}
/>
</span>
{ quirks?.isZilliqa1 && (
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="Number of Txns in DS Epoch:"
data={latestBlockChainInfo.NumTxnsDSEpoch}
title="Number of Txns in DS Epoch:"
data={latestBlockChainInfo.NumTxnsDSEpoch}
/>
</span>
</span>
)}
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="Number of Txns in Txn Epoch:"
data={latestBlockChainInfo.NumTxnsTxEpoch}
/>
{quirks?.isZilliqa1 && (
<span>
<ChainInfoItem
title="Number of Txns in Txn Epoch:"
data={latestBlockChainInfo.NumTxnsTxEpoch}
/>
</span>
)}
)}
<span>
<ChainInfoItem
title={
Expand Down

0 comments on commit bec7caf

Please sign in to comment.