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

add trailingComponent prop to CTABanner component #587

Merged
merged 3 commits into from
May 10, 2024

Conversation

joshfarrant
Copy link
Contributor

@joshfarrant joshfarrant commented May 8, 2024

Summary

Add trailingComponent prop to CTABanner as an escape hatch to render arbitrary content.

List of notable changes:

  • CTABanner component accepts a trailingComponent prop

Supporting resources (related issues, external links, etc):

What should reviewers focus on?

  • Check that spacing is correct around trailing component.

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

image

image

Copy link

changeset-bot bot commented May 8, 2024

🦋 Changeset detected

Latest commit: c58eda8

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

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook 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 May 8, 2024

🟢 No design token changes found

Copy link
Contributor

github-actions bot commented May 8, 2024

⚠️ Visual differences found

Our visual comparison tests found UI differences.

Please review the differences by using the test artifacts to ensure that the changes were intentional.

Artifacts can be downloaded and reviewed locally.

Download links are available at the bottom of the workflow summary screen.

Example:

artifacts section of workflow run

If the changes are expected, please run npm run test:visual:update-snapshots to replace the previous fixtures.

Review visual differences

@joshfarrant joshfarrant requested a review from rezrah May 8, 2024 08:23
@@ -43,6 +43,15 @@ test.describe('Visual Comparison: CTABanner', () => {
expect(await page.screenshot()).toMatchSnapshot()
})

test('CTABanner / With Trailing Component', async ({page}) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't see the new snapshot image in this PR. Could you try running it again please?

Copy link
Contributor Author

@joshfarrant joshfarrant May 8, 2024

Choose a reason for hiding this comment

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

Good spot 👍 Looks like they've generated now, although I'm not sure why Visual-Comparison-Tooltip-Tooltip-Label-Type-1-linux.png has changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nvm, looks like they just weren't regenerated after this commit

015bfea#diff-7e60c94a63a2596dd7d646b8d1bbd5bc87baf66db760adc47f70150c93b842e5

Looks fine to me

@@ -68,6 +76,7 @@ const Root = forwardRef(
>
<div className={clsx(styles['CTABanner-content'], align === 'center' && styles['CTABanner-content--center'])}>
{children}
{TrailingComponent && <TrailingComponent />}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@joshfarrant How does this look with align="center"? Could you share a screenie please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ofc, just added it to PR description

@joshfarrant joshfarrant requested a review from rezrah May 8, 2024 10:17
Copy link
Collaborator

@rezrah rezrah left a comment

Choose a reason for hiding this comment

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

This is looking great. Thanks @joshfarrant.

I can see visual tests are still being a bit flakey, so worth running one more time for luck before you merge this 😄 🤞

@joshfarrant joshfarrant merged commit 16b87f1 into main May 10, 2024
1 check passed
@joshfarrant joshfarrant deleted the joshfarrant/cta-banner-trailing-component branch May 10, 2024 07:45
@primer-css primer-css mentioned this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants