-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created the Block Details page #35
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saimeunt
requested changes
Jun 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dprof-in-tech Still not looking the same as Etherscan, please make the appropriate changes.
Okay chief
I’m working on it
…On Sat, Jun 29, 2024 at 10:26 PM saimeunt ***@***.***> wrote:
***@***.**** requested changes on this pull request.
@Dprof-in-tech <https://github.com/Dprof-in-tech> Still not looking the
same as Etherscan, please make the appropriate changes.
------------------------------
On src/app/block/[number]/txs/page.tsx
<#35 (comment)>:
This should not be removed, move your [block]/page.tsx to
[number]/page.tsx instead.
*The block slug is number, not block.*
------------------------------
In src/app/block/[block]/page.tsx
<#35 (comment)>:
> + {blockData.hash}
+ </DescriptionListItem>
+ <DescriptionListItem title="Parent Hash">
+ {blockData.parentHash}
+ </DescriptionListItem>
+ <DescriptionListItem title="Transactions">
+ <Link
+ href={`/block/${blockNumber}/txs`}
+ className="text-blue-600 hover:underline"
+ >
+ {blockData.transactions.length} transactions
+ </Link>
+ </DescriptionListItem>
+ <DescriptionListItem title="Gas Used">
+ {formatEther(blockData.gasUsed).toString()} (
+ {formatPercent(parseInt(blockData.gasUsed.toString()))})
This is not what we should display, see Etherscan as a reference:
Screenshot.2024-06-29.at.22.45.30.png (view on web)
<https://github.com/walnuthq/op-scan/assets/5597359/3e773207-5a78-4b24-b51a-384491c049e0>
We want to display the percentage of gas used over the gas limit.
You can get inspiration from the work done on the latest blocks page:
https://github.com/walnuthq/op-scan/blob/main/src/components/pages/blocks/latest-blocks-table.tsx#L39-L46
------------------------------
In src/app/block/[block]/page.tsx
<#35 (comment)>:
> + {blockData.parentHash}
+ </DescriptionListItem>
+ <DescriptionListItem title="Transactions">
+ <Link
+ href={`/block/${blockNumber}/txs`}
+ className="text-blue-600 hover:underline"
+ >
+ {blockData.transactions.length} transactions
+ </Link>
+ </DescriptionListItem>
+ <DescriptionListItem title="Gas Used">
+ {formatEther(blockData.gasUsed).toString()} (
+ {formatPercent(parseInt(blockData.gasUsed.toString()))})
+ </DescriptionListItem>
+ <DescriptionListItem title="Gas Limit">
+ {formatEther(blockData.gasLimit).toString()}
Again, this is not what we want, stick to the exact same display as
Etherscan.
See this as an inspiration:
https://github.com/walnuthq/op-scan/blob/main/src/components/pages/blocks/latest-blocks-table.tsx#L108
—
Reply to this email directly, view it on GitHub
<#35 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3W3TPJMSMOOOFQBVO3N4QDZJ4Q7HAVCNFSM6AAAAABKBCLRD6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNBZHAZDONJXHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
saimeunt
approved these changes
Jul 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #7
After the corrections, this is what it looks like