Skip to content

Conversation

@hussam-i-am
Copy link
Contributor

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

Closes https://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-am hussam-i-am self-assigned this Mar 25, 2025
@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2025

🦋 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
Name Type
@primer/react Minor

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-actions github-actions bot 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
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!

@hussam-i-am hussam-i-am requested a review from theinterned March 25, 2025 20:41
@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 105.84 KB (+0.03% 🔺)
packages/react/dist/browser.umd.js 106.15 KB (-0.1% 🔽)

@github-actions github-actions bot requested a deployment to storybook-preview-5820 March 25, 2025 20:46 Abandoned
@github-actions github-actions bot temporarily 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}

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?)

Copy link

@theinterned theinterned Mar 25, 2025

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
Contributor Author

Choose a reason for hiding this comment

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

Good idea!

@hussam-i-am hussam-i-am added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 25, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-5820 March 25, 2025 21:18 Inactive
@github-actions github-actions bot 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 owners March 25, 2025 21:34
@hussam-i-am hussam-i-am requested a review from langermank March 25, 2025 21:35
@github-actions github-actions bot requested a deployment to storybook-preview-5820 March 25, 2025 21:38 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5820 March 25, 2025 21:52 Inactive
@github-actions github-actions bot added the integration-tests: failing Changes in this PR cause breaking changes in gh/gh label Mar 26, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-5820 March 26, 2025 17:22 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5820 March 26, 2025 20:40 Inactive
@hussam-i-am hussam-i-am changed the title feat(Pagination): add renderPage prop to Pagination feat(Pagination): add renderPageLink prop to Pagination Mar 26, 2025
Copy link
Member

@joshblack joshblack left a comment

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!

@hussam-i-am hussam-i-am changed the title feat(Pagination): add renderPageLink prop to Pagination feat(Pagination): add renderPage prop to Pagination Mar 27, 2025
@primer-integration
Copy link

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

@primer-integration
Copy link

🔴 golden-jobs completed with status failure.

@hussam-i-am hussam-i-am added this pull request to the merge queue Mar 28, 2025
Merged via the queue into main with commit bd9225d Mar 28, 2025
44 checks passed
@hussam-i-am hussam-i-am deleted the hussam-i-am/pagination-render-page branch March 28, 2025 16:33
@primer primer bot mentioned this pull request Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants