Repository navigation
Paging component - #1995
Paging component#1995jamesmisson wants to merge 11 commits into
Conversation
|
@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @jamesmisson, this works as expected for me (though I didn't take the time to test all the edge cases like right-to-left or different pagination modes), and the code seems much cleaner than before. I have a couple of questions below, but they don't necessarily require action -- I'm just curious.
| expect(isPrevDisabledInitially).toBe(true); | ||
|
|
||
| await page.click(".btn.imageBtn.next"); | ||
| await page.$eval(".uv-btn.pagingControlButton.next", (el) => el.click()); |
There was a problem hiding this comment.
Just out of curiosity, why is a regular click call insufficient here?
| PreviousPage, | ||
| } from "../uv-shared-module/Icons"; | ||
|
|
||
| export type PagingDirection = "first" | "prev" | "next" | "last"; |
There was a problem hiding this comment.
I don't really object to using strings here, but would an enum be more appropriate?
Pull request description
Summary of changes
This changes the paging buttons into a React component,
PagingControls, following the pattern and style ofImageControls, using the newButtoncomponent. Now that styling is shared betweenPagingControlsandImageControls, I've added a mix-in.overlay-controls().This was also an opportunity to simplify the right-to-left/up-down direction logic.
This PR just does the basic React conversion and puts it at the bottom of the canvas - the canvas selection popover will come in a following PR.
I've changed the height of the header in this PR, which messes with the spacing of the PDF extension, which doesn't have equivalent React components to
PagingControlsandImageControlsyet. I'll need to come back to the PDF extension and apply all the same changes we've made to the OSD extension.Related issues
#1955
Contributor checklist
Accessibility & internationalisation
Compatibility & interoperability
Code quality & testing
Configuration & documentation
Additional notes for reviewers: