Added pagintation to account page
I split the long transaction list into pages, with controls at the bottom for navigation and a dropdown for the page size.
I had to learn about useEffect() and useState() and other react stuff, since this is the first time I have done react/nextjs specific programming, rather than just essentially writing TypeScript and HTML.
I tweaked the API to have a page and page_size parameter, which gets sent in the SQL query to the database, to just return the transactions needed.
I also made the tsx page fully client side, so I had to remove the async functionality and add the frontend origin (localhost:3000) to the CORS middleware allowed origins in the FastAPI backend.
One problem is that the entire transaction history is updated freqently, rather than just recent ones, so I need to figure out how to solve this problem without leaving stale pending transactions around.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.