-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Gutenberg] Set consistent editor colours in both the WordPress and Jetpack apps #19113
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
Changes from 34 commits
d22a59e
0948e1e
b68465a
5ee8d0c
38aac84
feb03ea
c85beaf
b4efa6a
256a4d2
9e64f2b
77e8e32
4fa4d0c
a1cce52
324fe7b
f4eb426
b6b76c5
4763d9c
57d86ea
7728b5a
a4080b1
15effd5
7fe6267
a8fb6ab
8544685
67ceaa0
d5a655b
0e3821d
ab3539c
233825f
fe50487
10ed59f
43b9994
1d5ba16
e034bc6
1eeb3ef
6b2d0d9
8868974
9f4c72a
a67b94b
56dab96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -374,6 +374,8 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega | |||||||
| super.viewWillAppear(animated) | ||||||||
| verificationPromptHelper?.updateVerificationStatus() | ||||||||
| ghostView.startAnimation() | ||||||||
| // `.editorPrimary` should be the tintColor that's used for action sheets when the editor appears. | ||||||||
| UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .editorPrimary | ||||||||
| } | ||||||||
|
|
||||||||
| override func viewDidAppear(_ animated: Bool) { | ||||||||
|
|
@@ -385,6 +387,8 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega | |||||||
|
|
||||||||
| override func viewWillDisappear(_ animated: Bool) { | ||||||||
| super.viewWillDisappear(animated) | ||||||||
| // Resets the action sheet's tintColor to `.primary` to prevent `.editorPrimary` being set as the tintColor for UI elements outside of the editor. | ||||||||
| UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .primary | ||||||||
|
||||||||
| let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) | |
| if mode == .richText, let contentInfo = contentInfo { |
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.
For UIAlertControllers created on the RN side (e.g. Image block -> Add Image -> Choose image), is there a reason why we're not trying to enforce the tint from there (if that's possible)? Or perhaps RN has no concept of the branding colors?
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.
If this can't be controlled / set from the RN side, I currently can't think of a better solution than what you have @SiobhyB. It's fascinating to me that the bottom sheet being presented by the editor isn't a descendant.
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.
For UIAlertControllers created on the RN side (e.g. Image block -> Add Image -> Choose image), is there a reason why we're not trying to enforce the tint from there (if that's possible)? Or perhaps RN has no concept of the branding colors?
Woah, yes, I just tested this quickly and it seems possible! It seems such an obvious solution, not sure why I went down such a complicated road with it now. 🤦♀️ Thanks so much @twstokes, I'll work on a Gutenberg PR.
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've gone ahead to create that PR at WordPress/gutenberg#42996 and have removed the (now redundant) calls within iOS in a67b94b.

Uh oh!
There was an error while loading. Please reload this page.