storacha / w3ui

👩‍🎤 Headless, type-safe, UI components for the next generation Web3.Storage APIs.
Other
64 stars 25 forks source link

add `prev` to UploadsListProvider context value #143

Open travis opened 1 year ago

travis commented 1 year ago

matching the next function that loads the next page of values, we should have a prev function that remembers the cursor of the page before the current one and navigates to it when prev is called.

this should be as simple as remembering the previous cursor in a new useState and using it in a new prev function that looks very similar to next

travis commented 1 year ago

@alanshaw suggested looking into adding this to the backend, which would be much cleaner on a bunch of levels, so I'm going to dig into how hard that would be