-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
RN: Add Icon Button Block Editor component. #25204
Conversation
Size Change: -29.2 kB (2%) Total Size: 1.17 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @enejb 👋
Thanks for moving this component into its own so it can be reused!
I think this component (that is mobile-only for now) should be in the packages/components/src/mobile
folder.
By moving it there, it'll prevent exposing the README file in the Block Editor Handbook docs.
What do you think?
Thanks for the feedback @geriux I went and moved the component from It turns out that there is already a component. Called Do we need to worry about deprecation on mobile? I wasn't able to find any (deprecated usage of) Should we maybe rename the component to something else? |
Thank you for the changes @enejb!
I checked the PR when it was deprecated and looks like we were only using it in Media & Text block but it was changed in favor of the new
I think we should, it might cause confusion if other people start seeing references to it, what I don't know is what name could work for it =P |
@geriux I updated the component to be called InserterButton. I don't have a better name yet :( What do you think? Would that work? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @enejb just left two comments. I like the InsertButton
name by the way 👍
@@ -16,6 +16,11 @@ import { __ } from '@wordpress/i18n'; | |||
*/ | |||
import styles from './style.scss'; | |||
|
|||
export const inserterButtonStyles = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think if instead of exporting the styles separately we do something like we do for the BottomSheet ?
So we have something like:
const InserterButton = withPreferredColorScheme( MenuItem );
InserterButton.Styles = inserterButtonStyles;
export default InserterButton;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I like that pattern. Lets go with that, thanks for pointing it out.
Co-authored-by: Gerardo Pacheco <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the changes @enejb!
Description
This PR adds the menu-item component into its own component now called "IconButton".
The main reason for splitting up the component is to be able to reuse it in 3rd party blocks.
How has this been tested?
Since this a mobile only component for now it has been tested in the following way.
It has been tested using the mobile demo app on both Android and iOS.
Screenshots
Andorid
iOS
Types of changes
This is mostly a refactor so that we can use the same use the new component in 3rd party plugins.
Checklist: