-
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] Set tintColor for ActionSheetIOS #42996
Conversation
These calls are going to be replaced with direct calls in Gutenberg: WordPress/gutenberg#42996
Size Change: 0 B Total Size: 1.27 MB ℹ️ View Unchanged
|
'usePreferredColorScheme' is used instead of 'usePreferredColorSchemeStyle' as only a hex code needs to be passed as a tintColor.
The UI tests in Gutenberg Mobile were failing as 'styles' returns 'undefined' (in the tests) when called from the 'PickerComponent' function. Example: https://app.circleci.com/pipelines/github/wordpress-mobile/gutenberg-mobile/18255/workflows/16df0260-7972-465b-b400-ec37603dfd9e/jobs/100060 This commit seeks to workaround that error by only calling the internal styles from the main Picker class.
I've created a separate PR to update all the CSS selectors in the picker's files to follow BEM naming convention at #43036. (I didn't want to send this PR off-course by doing it directly here, but also didn't want to leave the component's |
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. I tested these changes on an iPhone SE (iOS 15.6). Thanks!
.components-picker__button-title { | ||
color: $blue-50; | ||
} | ||
|
||
.components-picker__button-title--dark { | ||
color: $blue-30; | ||
} |
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.
These static colors make sense to me for the current goal — a consistent color within the editor. Long term, I would imagine we should revert this change so that the host app once again can control the picker colors.
…incorporate-consistent-tint-color
* Set tintColor on action sheets for iOS * [Code quality] Replace hex codes with CSS * [Code quality] Refine 'buttonTitleColor' const * Refactor code to use 'usePreferredColorScheme' 'usePreferredColorScheme' is used instead of 'usePreferredColorSchemeStyle' as only a hex code needs to be passed as a tintColor. * Refactor to workaround test failures The UI tests in Gutenberg Mobile were failing as 'styles' returns 'undefined' (in the tests) when called from the 'PickerComponent' function. Example: https://app.circleci.com/pipelines/github/wordpress-mobile/gutenberg-mobile/18255/workflows/16df0260-7972-465b-b400-ec37603dfd9e/jobs/100060 This commit seeks to workaround that error by only calling the internal styles from the main Picker class. Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com>
Related PRs
gutenberg-mobile
: [RNMobile] Set tintColor for ActionSheetIOS wordpress-mobile/gutenberg-mobile#5074What?
This PR explicitly sets a
tintColor
on the ActionSheetIOS component.Why?
At the moment, the
tintColor
is not explicitly defined and it's easy for it be unintentionally overridden by host apps. Explicitly setting the value will avoid any unintentional overides.How?
The ActionSheetIOS component's
tintColor
prop is used in combination with theusePreferredColorScheme
hook to set different colours for light/dark mode.Testing Instructions
add image
. Another option for accessing the component is to tap the ellipsis in the bottom right of a block for the actions menu.Screenshots or screencast