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

fix(Pagination): use empty li for ellipsis #2942

Open
wants to merge 14 commits into
base: next
Choose a base branch
from

Conversation

eirikbacker
Copy link
Contributor

  • Using empty li for ellipsis

@eirikbacker eirikbacker self-assigned this Jan 3, 2025
Copy link

changeset-bot bot commented Jan 3, 2025

🦋 Changeset detected

Latest commit: 76d830d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@digdir/designsystemet-css Patch
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-theme Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 3, 2025

Preview deployments for this pull request:

Storybook - 6. Jan 2025 - 12:40

Copy link
Contributor

github-actions bot commented Jan 3, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 55.14% 3198 / 5799
🔵 Statements 55.14% 3198 / 5799
🔵 Functions 85.84% 182 / 212
🔵 Branches 77.31% 525 / 679
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/Pagination/usePagination.ts 100% 95.83% 100% 100%
Generated in workflow #1459 for commit 76d830d by the Vitest Coverage Report Action

packages/css/src/button.css Outdated Show resolved Hide resolved
@@ -64,13 +64,13 @@ export const usePagination = ({
(page, index) => ({
page: page || '',
Copy link
Collaborator

@mimarz mimarz Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just mark it explicit as ellipsis if its an ellipsis?

Suggested change
page: page || '',
page || 'ellipsis',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be now that we type check typeof page === 'number' ☺️

Copy link
Collaborator

@mimarz mimarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a suggestion in usePagination for ease of use.

@mimarz
Copy link
Collaborator

mimarz commented Jan 6, 2025

We should also make a return type for usePagination :/

@Barsnes
Copy link
Member

Barsnes commented Jan 6, 2025

We should also make a return type for usePagination :/

We should probably make a page for usePagination, since we have this for other hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 Ready for review
Development

Successfully merging this pull request may close these issues.

3 participants