-
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
[RNMobile] Gallery - Button #18264
[RNMobile] Gallery - Button #18264
Conversation
disabled={ isDisabled } | ||
> | ||
<View style={ buttonStyle }> | ||
{ isString( icon ) ? |
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.
isString
check is done inside Icon component, it shouldn't be necessary here, in theory...
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.
You're quite right about that 😄 thanks for pointing it out. I've removed the isString
check.
Right, I think we need more props for Icon positioning/size and we need to allow overriding styles for active and disabled states separately. I believe this can be investigated as a part of wordpress-mobile/gutenberg-mobile#1411 Currently web is using CSS to override button styles but we don't have a way to do the same. It is tough to re-design a component from |
Hi Pinar, thanks for taking a look at this one.
I think that makes a lot of sense, especially if we are aiming for a general cross-platform solution there. Thanks for linking to the issue tracking the cross-platform development for Button. For the scope of this PR (and the related native Gallery work), is it acceptable to have this separate implementation of |
I think cross-platform Button component will cover this anyway so I just want to avoid re-work, and we want to make it happen not later than ~2 months. Could you list what kind of changes needs to be done in |
Merged into |
I'll open an issue for that, and link it here: wordpress-mobile/gutenberg-mobile#1411. |
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* WIP - add gallery button * Fix lint errors * Remove isString check from gallery button
* Add native gallery - gallery image * WIP - refactor native gallery image * WIP - gallery image - deselect caption when image tapped * Add MediaUploadProgress to GalleryImage * Extract styles from gallery image * Add failed upload UI to gallery image * Remove HOC from gallery image * Remove unused props / methods in gallery image * Remove gallery image when upload is cancelled * Remove unused code from gallery image * Use accessibilityLabel prop on gallery image buttons * Remove href code from gallery image * Extract remaining styles from gallery image * Fix lint errors * [RNMobile] Gallery - Button (#18264) * WIP - add gallery button * Fix lint errors * Remove isString check from gallery button * Fix isCropped style for mobile gallery image * Accept style override props in RichText CAPTION - Fix lint * Add colorScheme styles for gallery image container * Add buttonActive style for gallery image * Clean up button styles on gallery image * Fix lint * Fix lint * Use withPreferredColorScheme in gallery image * Fix lint * Add some caption styles to gallery image * Use withPreferredColorScheme HOC for gallery caption * Refactor GalleryImage styles * Condense gallery changes to native RichText component * Extract gallery caption type flags for readability * Use RichText force blur prop in GalleryImage * Add ellipsis mode and ScrollView to gallery caption * Fix lint * Remove unnecessary View from gallery button * Adjust gallery button icon styles * Center align gallery caption text * Adjust gallery caption font-size to 12px * Use RichText to display unselected GalleryImage caption * Use child-first approach for gallery image UI components * Fix lint * Use full height for gallery caption scroll view * Use transparent background by default for gallery caption * Eliminate <p> tags in gallery image caption * Use variables instead of functions in gallery image scss * Extract gallery button icon sizes to constants * Tidy up gallery image style constants * Fix scss imports for jest * Use "p" tagName in gallery image on iOS to fix alignment
Description
This PR introduces a
Button
component for the semi-cross-platform Gallery block. The purpose of this component is to provide UI buttons that can be styled for the native implementation of the Gallery block.This
Button
component is used by theGalleryImage
component introduced here: #18155. The web implementation of the Gallery block usesIconButton
, which, in turn, usesButton
from@wordpress/components
. Initially, I attempted to use the mobile implementation ofIconButton
, and thenButton
, but I struggled to find a way to make this work. Our mobile implementation of theButton
component seemingly lacks a way to style the button for the purpose of the gallery image.Ideally,
Button
(orIconButton
) from@wordpress/components
can be general enough to allow re-use from theGalleryImage
component, supporting the respective designs, but perhaps it's best to constrain the scope here for the first iteration of mobile Gallery block, as the potential for reuse ofButton
may require a wider set of changes.The changeset here is used in the related "parent" PR: #18111, which includes these changes integrated with related changes in other components necessary for the gallery block.
To test
Test this component via the main draft PR.
Checklist: