-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[RNMobile] Search Block: Basic UI #29045
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
Conversation
Only adds a shell of a block.
This alert will be removed once styling is added in a later PR.
This will keep the code cleaner and easier to follow.
This toolbar action is now visible in the UI so the temporary alert message is no longer needed.
Was causing issues with layout in iOS. Styling will be addressed fully in a different PR.
|
Size Change: 0 B Total Size: 1.38 MB ℹ️ View Unchanged
|
4d3fe33 to
58ba580
Compare
| <RichText | ||
| className="wp-block-search__label" | ||
| style={ { | ||
| ...styles.searchLabel, |
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.
Nice use of spread attributes 👍
cameronvoell
left a comment
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.
Tested in WPAndroid, looks really good! I'll keep an eye out on the known issues and the button position changes in future PR. This looks and works great though 🎉
| const getBlockClassNames = () => { | ||
| return classnames( | ||
| className, | ||
| 'button-inside' === buttonPosition |
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.
I think some of this function could be simplified by creating a map
Something like
const buttonPostionToClassMap = {
'button-inside' : 'wp-block-search__button-inside',
'button-outside': 'wp-block-search__button-outside',
'no-button': 'wp-block-search__no-button',
'button-only': 'wp-block-search__button-only',
}
let noButtonClass = null;
if( 'no-button' !== buttonPosition ) {
noButtonClass = buttonUseIcon ? 'wp-block-search__text-button' : 'wp-block-search__text-button';
}
return classnames(
className,
buttonPosition && buttonPostionToClassMap [ buttonPosition ],
noButtonClass
);
Let me know what you think :)
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.
Thanks for this @enejb ! This PR is already merged, but I have many more in the pipeline so I'll use this code in the future!
Description
This PR builds on two previous PRs #28983 and #28985 (
those two have to be merged before this one can be taken out of draftdone!). This PR adds the block UI components and simple styling. Full styling won't be added until a later PR when designs have been finalized. Working features include:Not included:
Screen.Recording.2021-02-16.at.2.47.53.PM.mov
Gutenberg mobile PR
wordpress-mobile/gutenberg-mobile#3186
Known issues
RichTextand supports formatting but for some odd reason color changes only seem to work in the WordPress app, and not in the demo. Example:How has this been tested?
Test the following scenarios and verify the component updates appropriately:
Types of changes
Part of a new feature to port the Search block to mobile
Checklist: