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

Consolidate the Button component implementations for use in blocks #14935

Closed
pablinos opened this issue Mar 10, 2020 · 3 comments
Closed

Consolidate the Button component implementations for use in blocks #14935

pablinos opened this issue Mar 10, 2020 · 3 comments

Comments

@pablinos
Copy link
Contributor

pablinos commented Mar 10, 2020

The problem

We currently have three implementations of a button component that are used to add buttons to some of the blocks. A common pattern is to have a button block style as well as an inline style for embed blocks like Eventbrite and Calendly. A button is also used as an InnerBlock of the contact form and similarly with the Revue block. It's also used with the MailChimp and Recurring Payments blocks.

The main SubmitButton implementation has got out of sync with the core button block component and doesn't have the same features. The other two implementations were an attempt to remedy this, with the version used in the Revue block being closest to the current core version.

Proposed solution

We have been discussing the best approach to reusing the core button components. The current favoured solution is to adapt the button block so that the link settings UI can be turned off and then the button block can be used within block variations. This could work in some situations and needs to be explored further, but in the meantime, it seems appropriate to consolidate the implementations we currently have and get all the blocks using a button component that's as similar as possible to the core Gutenberg version.

To this end, @Copons has been exploring this with a PR to make the button used in the Revue block shared, and another PR that uses this shared component in the other blocks.

This issue is to track progress on those PRs as well as other possible solutions within Gutenberg.

@pablinos
Copy link
Contributor Author

Just linking to @copons comment that summarises the situation. The plan is to combine #14630 and #14761 with the new #14920 and #14931

@Copons
Copy link
Contributor

Copons commented Mar 11, 2020

Thanks for wrangling this @pablinos!
I'll try to add the Calendly button (based upon #14761) in the Button example PR (#14931) and see what happens, and then update the Button main PR (#14920) with the needed changes.

@creativecoder
Copy link
Contributor

We have a series of issues for updating each individual block to use this component, so I'm going to close this issue.

https://github.com/Automattic/jetpack/issues?q=is%3Aopen+is%3Aissue+label%3A%22%5BBlock%5D+Button%22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment