Skip to content

feat(Pagination): add renderPage prop to Pagination - #5820

Merged
hussam-i-am merged 21 commits into
mainfrom
hussam-i-am/pagination-render-page
Mar 28, 2025
Merged

feat(Pagination): add renderPage prop to Pagination#5820
hussam-i-am merged 21 commits into
mainfrom
hussam-i-am/pagination-render-page

Conversation

@hussam-i-am

@hussam-i-amhussam-i-am commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

Closeshttps://github.com/github/primer/issues/4946

Changelog

New

  • Adds renderPage prop to support render custom links within the Pagination component.
  • Creates shared ReactRouterLink mock to be shared among tests
  • Adds new tests

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@hussam-i-amhussam-i-am self-assigned this Mar 25, 2025
@changeset-bot

changeset-botBot commented Mar 25, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bbbe613

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

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

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

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Mar 25, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions

github-actionsBot commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js105.84 KB (+0.03% 🔺)
packages/react/dist/browser.umd.js106.15 KB (-0.1% 🔽)

@github-actions
github-actionsBot requested a deployment to storybook-preview-5820 March 25, 2025 20:46 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5820 March 25, 2025 20:59 Inactive
currentPage={1}
renderPageLink={({content, key, className}) => (
<ReactRouterLikeLink key={key} className={className} to={`#${content}`}>
{content}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the content could be a page number, but it could also be Next or Previous I think? Maybe we need an additional pageNum (or the actual page / page.num from model.tsx?)

@theinternedtheinternedMar 25, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It would be nice if content was children ... then the API could be

renderPageLink={({pageNum, ...props})=><Link{...props}to={`#${pageNum}`}/>}

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good idea!

@hussam-i-amhussam-i-am added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 25, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5820 March 25, 2025 21:18 Inactive
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 25, 2025
@hussam-i-am
hussam-i-am marked this pull request as ready for review March 25, 2025 21:34
@hussam-i-am
hussam-i-am requested review from a team as code ownersMarch 25, 2025 21:34
@github-actions
github-actionsBot requested a deployment to storybook-preview-5820 March 25, 2025 21:38 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5820 March 25, 2025 21:52 Inactive
@github-actionsgithub-actionsBot added the integration-tests: failing Changes in this PR cause breaking changes in gh/gh label Mar 26, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5820 March 26, 2025 17:22 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5820 March 26, 2025 20:40 Inactive
@hussam-i-amhussam-i-am changed the title feat(Pagination): add renderPage prop to Paginationfeat(Pagination): add renderPageLink prop to PaginationMar 26, 2025

@joshblackjoshblack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left some quick comments, let me know what you think!

Comment threadpackages/react/src/Pagination/Pagination.features.stories.tsx Outdated
Comment threadpackages/react/src/Pagination/Pagination.tsx Outdated
Comment threadpackages/react/src/Pagination/Pagination.tsx Outdated
@hussam-i-amhussam-i-am changed the title feat(Pagination): add renderPageLink prop to Paginationfeat(Pagination): add renderPage prop to PaginationMar 27, 2025
@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/369948

@primer-integration

Copy link
Copy Markdown

🔴 golden-jobs completed with status failure.

@github-actions
github-actionsBottemporarily deployed to storybook-preview-5820 March 28, 2025 16:19 Inactive
@hussam-i-am
hussam-i-am added this pull request to the merge queueMar 28, 2025
Merged via the queue into main with commit bd9225dMar 28, 2025
@hussam-i-am
hussam-i-am deleted the hussam-i-am/pagination-render-page branch March 28, 2025 16:33
@primerprimerBot mentioned this pull request Mar 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: failingChanges in this PR cause breaking changes in gh/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hussam-i-am@theinterned@joshblack