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(button): update types hasIconOnly & kind !== danger #17272

Conversation

ariellalgilmore
Copy link
Member

Closes #17036

[warnings visible when setting the wrong kind]
Screenshot 2024-08-26 at 10 55 22 AM

Changelog

Changed

  • update ButtonBaseProps kind to equal hasIconOnly ? iconButtonKind : buttonKind
  • and updated Button.propTypes similarily to above^

Testing / Reviewing

  • Go to storybook button confirm no warning errors
  • go to storybook button -> icon button and change the kind to "danger" and see warnings

Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 860da92
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66ccc225dcd9550008f00cea
😎 Deploy Preview https://deploy-preview-17272--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 860da92
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66ccc22594535400083bb802
😎 Deploy Preview https://deploy-preview-17272--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 02e9df4
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66e1dccf56db530008d62d16
😎 Deploy Preview https://deploy-preview-17272--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 02e9df4
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66e1dccf2c579b0008a39d85
😎 Deploy Preview https://deploy-preview-17272--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ariellalgilmore ariellalgilmore marked this pull request as ready for review August 26, 2024 18:16
@ariellalgilmore ariellalgilmore requested review from a team as code owners August 26, 2024 18:16
Copy link
Member

@emyarod emyarod 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 to me!

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.82%. Comparing base (b3bba86) to head (02e9df4).

Files with missing lines Patch % Lines
packages/react/src/components/Button/Button.tsx 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17272   +/-   ##
=======================================
  Coverage   76.82%   76.82%           
=======================================
  Files         408      408           
  Lines       13958    13966    +8     
  Branches     4333     4336    +3     
=======================================
+ Hits        10723    10730    +7     
  Misses       3062     3062           
- Partials      173      174    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 11, 2024
@ariellalgilmore ariellalgilmore added this pull request to the merge queue Sep 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2024
@ariellalgilmore ariellalgilmore added this pull request to the merge queue Sep 12, 2024
Merged via the queue into carbon-design-system:main with commit a6f1b23 Sep 12, 2024
36 checks passed
@ariellalgilmore ariellalgilmore deleted the fix/button-conditional-kind-hasicononly-types branch September 12, 2024 01:29
@carbon-automation
Copy link
Contributor

Hey there! v11.66.0 was just released that references this issue/PR.

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.

Button: Update types to be a conditional proptype (or a union in TS) of if hasIconOnly, kind !== "danger"
3 participants