Repository navigation
[RNMobile] Overwrite Missing block Alert Strings - #25238
Conversation
|
Size Change: 0 B Total Size: 1.17 MB ℹ️ View Unchanged
|
3de115d to
b61e614
Compare
|
Hey @Tug ! The idea is to be able to define strings outside Here you can see how is this being used. Thank you! 🙏 |
b61e614 to
c6bcaf0
Compare
|
Hey @marecar3 - Thanks for the update! There seems to be a build/syntax error cached by the CI. Could you take a look? |
Thanks for letting me know. WIll look at it. |
59b3bf8 to
b24b33c
Compare
This is resolved. |
There was a problem hiding this comment.
Is there anything we can do to improve the names here while avoiding Jetpack or similiar? I'm not sure "switchable" or "switch" describes this.
There was a problem hiding this comment.
I really hope so and I'm open to suggestions 😄
This is meant to describe the possibility to activate Unsupported Block Editor if it's not active.
(i.e: Jetpack sites can, but self-hosted sites can't)
What about isUnsupportedBlockEditorActivable. (Still confusing, "Will it activate the Editor or the feature?")
We could be more descriptive:
unsupportedBlockEditorCanBeEnabled.
There was a problem hiding this comment.
I think unsupportedBlockEditorCanBeEnabled is a definite improvement. 👍 We could maybe tighten that up a bit to canEnableUnsupportedBlockEditor?
Another option would be to instead have a single unsupportedBlockEditorCapability field that carried an enum-like value across the bridge with values like "supported", "canEnable", and "notCapable". I like how this conveys that these are mutually exclusive (at least I think they are, let me know if I'm mistaken about that), whereas the separate boolean fields we have currently (separately representing "supported" and "can-be-enabled") don't make it as clear (based on the types) how they relate to each other. Just a thought, I don't think this is a critical change.
There was a problem hiding this comment.
Another option would be to instead have a single unsupportedBlockEditorCapability field that carried an enum-like value across the bridge
This thought came to mind too when I saw this extra info being needed. I don't think it would be a huge refactor, but it touches the other areas with capability dependency, so I decided to no do a refactor of this kind on this PR.
Probably better sooner than later anyway.
canEnableUnsupportedBlockEditor
I like it! Let's settle with this one for now :yay:
guarani
left a comment
There was a problem hiding this comment.
I think this works well, I tested from WPiOS and WPAndroid.
I'm not excited about the naming of variables, but I appreciate it's hard to find good names without being too specific.
4be05a5 to
0f6fbe1
Compare
2a005ce to
718f8b5
Compare
| return { ...previous, ...current() }; | ||
| }, {} ); | ||
|
|
||
| export const withUIStrings = ( WrappedComponent ) => ( props ) => ( |
There was a problem hiding this comment.
I like this HOC a lot! 😀
I agree with @guarani 's comment about it being a bit unclear that "UiStrings" are just strings that need to come from native though. Maybe something like "withNativeStrings" or withStringsFromNative" would be clearer. Or perhaps a comment here would be a better way to make it clear. Obviously I don't have a great solution here. 😞
There was a problem hiding this comment.
I wasn't sure about this name either :)
The rationale was to stress on that these strings are Text displayed on UI elements to the final user.
Even though it's declared on mobile components, I guess this could be used by web if needed (there's nothing Native on this). They might have a different way of approaching these needs though. I'm not sure.
I was also talking with @Tug about finding a better/more-gutenberg way of doing this, so I wouldn't worry too much since this might change soon.
There was a problem hiding this comment.
Do we expect a lot more strings to come from native? In that case I do understand this approach. For now I'm not that much in favor of it though as it's a native specific HOC and it will just make our life harder when we'll try to make x-platform components
There was a problem hiding this comment.
Do we expect a lot more strings to come from native?
So far I don't really think so. Things like this will be used only if we need to show text not allowed to be committed on this repo. This shouldn't happen very often.
As mentioned, I'll test the filter approach and make the change if it works as expected on a upcoming PR.
mchowning
left a comment
There was a problem hiding this comment.
Left a couple of small comments, but no blocking issues. Nice work! 👍
… button pressed action
386548c to
e35e52e
Compare
gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#2610
WPiOS PR: wordpress-mobile/WordPress-iOS#14880
WPAndroid: wordpress-mobile/WordPress-Android#13011
Note: This PR depends on #24476
This PR allows us to define UI Strings to be overwritten by the client.
We are implementing this on the Mobile version of the Missing block. Which allows us to show different Text depending on the kind of site the user has.
Description
How has this been tested?
Screenshots
Types of changes
Checklist: