-
Notifications
You must be signed in to change notification settings - Fork 22
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
Latest blocks page #19
Comments
Hi! Can I hop on this? Plus I am already working on the block transactions issue, I think I can work on this as a continuation of that issue. How I would approach this:
|
Hi, i would like work in this issue Detailed Approach to Creating a Block Display Component
|
Hey! I would love to work on this issue! How I would implement the latest blocks page
I already have decent experience in building pagination, be it with or without Shadcn UI, so I feel I would be a great fit for this task |
I'm interested in implementing the Latest Block page for the Op Scan Project. This is my first time contributing to a Walnut project. With my 3 years of solid background in Next.js, TypeScript, Shadcn, and React, I’m very sure that i will deliver an efficient and user-friendly blocks page. You can check out my GitHub profile here: My Github Profile Proposed Solution for Latest Blocks PageComponent Creation:
Fetching Data:
Table Structure:
Pagination:
Linking to Details:
UI Components:
Performance Optimization:
Testing and Validation:
I am confident that my approach will deliver a high-quality and user-friendly Latest Blocks page. I will do my best to deliver on this issue promptly and ensure it meets the project's standards. |
Plan to Resolve the Issue: Latest Blocks PageHello walnut team, I would love to work on this issue and here is my proposal for the implementation: Problem DescriptionThe objective is to develop a page that displays a paginated list of the latest blocks created on the blockchain. This list should include:
The visualization should resemble the latest blocks list on Etherscan, without additional metrics such as network utilization or block size. Implementation Plan1. Project Structurea. Create the Route for Blocks:
b. Implement the API to Fetch Blocks:
c. Table Component:
d. Pagination:
2. Technical Detailsa. Use of React Server Component (RSC):
b. Progress Bar:
c. Detail Links:
3. Verification and Testinga. Pagination Verification:
b. Data Verification:
c. Link Navigation:
ConclusionMy plan outlines a complete and careful implementation that follows Next.js best practices and uses Shadcn components for a clean and efficient user interface. This solution not only meets the specific requirements of the issue but also ensures an intuitive user experience and a technically sound implementation. I hope to have the opportunity to work on this issue and contribute significantly to the project. Thank you for considering my proposal. Best regards, |
@Benjtalkshow this one is for you! I appreciate your proposal, while reading it a couple things came to my mind: Please make sure you are following along the latest NextJS way of approaching Server Side Rendering which is the app router and React Server Components, Regarding pagination, it should be done almost entirely server-side using the
Finally, everything related to caching is an after thought and out of scope for this issue, as well as cross browser support and responsive design, we assume shadcn/ui sane defaults will be more than enough. |
Thank you for assigning this task to me. |
@Benjtalkshow how is it going with the issue? Are you still working on this? Please note that if you're not providing at least a draft PR by the end of Wednesday we'll have to assign someone else. |
@saimeunt Good day sir, i am currently working it. i will provide feedback soon. |
Latest blocks page
Read contributors guidelines
User stories
/blocks
Validation
It should look like the Etherscan latest blocks list: https://optimistic.etherscan.io/blocks
For the gas used column, you should add the percentage against gas limit and you can show a progress bar using https://ui.shadcn.com/docs/components/progress
Don't forget to add links to block details page
/block/:number
and block txs/block/:number/txs
page.Do NOT include block metrics such as Network utilization, block size, etc.
Do NOT add a "Download Page Data" button.
Do NOT add a "Show rows" dropdown, this is out of scope for this issue.
Implementation
Use a simple table from shadcn/ui, always display 25 blocks and use a query parameter to handle pagination:
If current block head is 100 then
/blocks
=> blocks 100 => 76/blocks?p=2
=> blocks 75 => 51/blocks?p=3
=> blocks 50 => 26Use client state to keep track of the latest block number upon first visiting the page, and use this as a reference for navigation: when we click on page 2, we want to see the next 25 blocks from the initial block head (100), not the next 25 blocks from the new current block head.
You must use NextJS best practices about handling query parameters, in particular, read
searchParams
from the top-level Page component and use a React Server Component to fetch the blocks needed. Do NOT fetch the blocks client-side.Resources
The text was updated successfully, but these errors were encountered: