Repository navigation
Update block variations transforms to use ToggleGroupControl - #45680
daledupreez wants to merge 1 commit into
Conversation
|
|
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @daledupreez! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
| ); | ||
| } | ||
|
|
||
| function VariationsDropdown( { |
There was a problem hiding this comment.
One question/concern I have is around whether we want to keep the existing UI for cases where we don't have unique icons. I would be happy to reduce the scope of the PR and reinstate the VariationsDropdown logic if we decide that would be a better UX.
|
Thanks for opening this PR @daledupreez! Unfortunately there's also another PR that implements the same feature over in #45654 |
|
Closing this in favour of the more advanced work in #45654. |
What?
This PR refactors the control used by the block variations transforms section in the block editor to use the
ToggleGroupControlcomponent instead of the custom components it is using at present.Why?
As suggested in #43415, this update should reduce code duplication and make the component more accessible by default.
How?
I refactored the code to rely on a
ToggleGroupControlinside a wrapper div that uses the existingblock-editor-block-variation-transformsclass. If we have unique icons for each variation, we insertToggleGroupControlOptionIconchildren, but if we don't we insertToggleGroupControlOptionchildren.Testing Instructions
Screenshots or screencast
block-variation-transforms-toggle-group-control.mov