Skip to content
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

add prev to UploadsListProvider context value #143

Open
travis opened this issue Dec 6, 2022 · 1 comment
Open

add prev to UploadsListProvider context value #143

travis opened this issue Dec 6, 2022 · 1 comment
Assignees
Milestone

Comments

@travis
Copy link
Member

travis commented Dec 6, 2022

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 travis added dif/easy Someone with a little familiarity can pick up good first issue Good for newcomers packages/react labels Dec 6, 2022
@travis travis self-assigned this Dec 6, 2022
@travis travis mentioned this issue Dec 6, 2022
4 tasks
@heyjay44 heyjay44 added this to the w3up phase 2 milestone Dec 7, 2022
@travis travis removed their assignment Jan 6, 2023
@travis travis self-assigned this Jan 25, 2023
@travis travis removed dif/easy Someone with a little familiarity can pick up good first issue Good for newcomers labels Feb 1, 2023
@travis
Copy link
Member Author

travis commented Feb 1, 2023

@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

travis added a commit to storacha/w3up that referenced this issue Feb 6, 2023
Per storacha/w3ui#143 we'd like to give
clients a way to get the previous page of results rather than the next
page.

This change introduces a `prev` caveat which, when set to true, will
return the page of results preceding `cursor`.

I considered calling this `reverse` or `rev` but I think that implies
that results will be returned sorted in reverse, which is not
the intent.
travis added a commit to storacha/w3up that referenced this issue Feb 10, 2023
Per storacha/w3ui#143 we'd like to give
clients a way to get the previous page of results rather than the next
page.

This change introduces a `pre` caveat which, when set to true, will
return the page of results preceding `cursor`.

I considered calling this `reverse` or `rev` but I think that implies
that results will be returned sorted in reverse, which is not the
intent.

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
gobengo pushed a commit to storacha/w3up that referenced this issue Apr 11, 2023
Per storacha/w3ui#143 we'd like to give
clients a way to get the previous page of results rather than the next
page.

This change introduces a `pre` caveat which, when set to true, will
return the page of results preceding `cursor`.

I considered calling this `reverse` or `rev` but I think that implies
that results will be returned sorted in reverse, which is not the
intent.

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants