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

refactor(CopyButton): inherit Copy component #5006

Merged

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Jan 10, 2020

Closes #5005

this PR refactors the <CopyButton> to directly inherit <Copy>. neither component is exported but the component only differs in that <Copy> appears to only be used in inline code snippets, and <CopyButton> is used for the other code snippet variants. since the behavior is identical it can all be contained in <Copy>

Changelog

Changed

Testing / Reviewing

Ensure the CopyButton and code snippet variants function as expected

@netlify
Copy link

netlify bot commented Jan 10, 2020

Deploy preview for the-carbon-components ready!

Built with commit c90d77e

https://deploy-preview-5006--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Jan 10, 2020

Deploy preview for carbon-components-react ready!

Built with commit c90d77e

https://deploy-preview-5006--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Jan 10, 2020

Deploy preview for carbon-elements failed.

Built with commit c90d77e

https://app.netlify.com/sites/carbon-elements/deploys/5e1ca37f2856660008cfb156

@asudoh asudoh requested review from a team and aagonzales and removed request for a team January 11, 2020 03:01
Copy link
Member

@aagonzales aagonzales 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!

Though as an extra can we change the text from "Feedback enabled 👍 " to "Copied to clipboard".

image

@emyarod emyarod force-pushed the 5005-copybutton-inherit-copy branch from 01f356e to 24b2b66 Compare January 13, 2020 17:05
Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@tw15egan tw15egan merged commit 6e63ccf into carbon-design-system:master Jan 13, 2020
@emyarod emyarod deleted the 5005-copybutton-inherit-copy branch January 13, 2020 18:19
joshblack pushed a commit to joshblack/carbon that referenced this pull request Jan 23, 2020
* refactor(CopyButton): inherit Copy component

* refactor(code-snippet): unnest rules

* test(CopyButton): full mount for button props test

* docs(CodeSnippet): change default story feedback text
This was referenced Feb 25, 2020
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.

Compose event handlers for CopyButton
6 participants