-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat: useLocationsView hook #5908
base: feat-storage-browser/main
Are you sure you want to change the base?
feat: useLocationsView hook #5908
Conversation
|
packages/react-storage/src/components/StorageBrowser/views/LocationsView/useLocationsView.ts
Show resolved
Hide resolved
| { type: 'paginate-next' } | ||
| { type: 'paginate-previous' } |
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.
After thinking on this change a bit more think we will need to provide a single paginate
action:
// where page is the target page
{ type: 'paginate'; page: number }
to allow for consuming UI components to receive a single onPaginate
prop, which enables custom Paginate
components to render with more than two buttons
packages/react-storage/src/components/StorageBrowser/views/LocationsView/useLocationsView.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/views/LocationsView/useLocationsView.ts
Outdated
Show resolved
Hide resolved
packages/react-storage/src/components/StorageBrowser/views/hooks/usePaginate.ts
Outdated
Show resolved
Hide resolved
useLocationsDataSpy.mockReturnValue(nextPageState); | ||
|
||
// go forward | ||
await act(async () => { |
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.
we shouldn't have to add act
here -- but we have this issue in the repo
Description of changes
Refactor LocationsView based the WIP Hooks Api Doc.
Doesn't implement everything yet, like options for the hook but supports everything we have currently.
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passes and tests are updated/addeddocs
,e2e
,examples
, or other private packages.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.