-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] Block title in unsupported block #18268
Conversation
…ng original name in place of 'Unsupported'.
…ause the small icon was too hard to press. Also rearranging the BottomSheet to work the height paddings out correctly.
…or the help block. Few color changes. Adding some text to the help block.
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.
text-align: center; | ||
} | ||
|
||
.infoTitle { |
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 we must create a infoTitleDark
class and update the color.
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.
Addressed with 5a9e429.
color: $gray-dark; | ||
} | ||
|
||
.infoDescription { |
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.
Same as for infoTitle
, we should create a infoDescriptionDark
class and update the color.
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.
Addressed with 5a9e429.
> | ||
<View style={ styles.infoContainer } > | ||
<Icon icon="editor-help" style={ styles.infoIcon } size={ styles.infoIcon.size } /> | ||
<Text style={ [ styles.infoText, styles.infoTitle ] }> |
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.
We should call getStylesFromColorScheme
on there.
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.
Addressed with 5a9e429.
<View style={ styles.infoContainer } > | ||
<Icon icon="editor-help" style={ styles.infoIcon } size={ styles.infoIcon.size } /> | ||
<Text style={ [ styles.infoText, styles.infoTitle ] }> | ||
{ __( '\'' + title + '\' isn\'t yet supported on WordPress for ' + platformText ) } |
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 can't compose strings inside __()
, you need to use sprintf
instead and add a placeholder for the title. For the platform, I think it's safer to have one string for iOS and one for Android, since it's more obvious for translators.
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.
Addressed with 4c2b904, 6815b3c.
} | ||
|
||
renderSheet( title ) { | ||
return <BottomSheet |
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'm surprised that it's not caught by the lint job, but I noticed a different JSX style in this file than the rest of the code: we normally wrap the returned JSX in parentheses and jump to a new line:
return (
<BottomSheet
isVisible={ this.state.showHelp }
hideHeader
onClose={ this.toggleSheet.bind( this ) }
>
{ /* ... */ }
</BottomSheet>
);
I can't find it mentioned in any coding style guide, but that's the style I've seen and written everywhere else.
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.
Addressed in f7c8582.
👋 @maxme and @koke , thanks for the review! I've addressed your comments and this is ready for another pass. I've also removed the "Close" button from the bottom sheet as we don't have such a dismiss button in other bottom sheets anyway. cc @iamthomasbishop, there was a relevant question in the original PR and I went with a "No" here... let me know if you think we should reinstate the Close button. |
} | ||
|
||
renderHelpIcon() { | ||
return <TouchableWithoutFeedback |
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.
There are also parentheses missing here. Also FYI, suggested this as a lint rule in #18302
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.
Addressed with e863087.
|
||
// translators: %s: Name of the block | ||
const titleFormat = Platform.OS === 'android' ? __( '\'%s\' isn\'t yet supported on WordPress for Android' ) : | ||
__( '\'%s\' isn\'t yet supported on WordPress for iOS' ); |
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.
Not an issue for this PR, but noting for the future: I just realized this might be used in other apps, so we should find a way to inject the app name from the apps instead.
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.
Good point!
Addressed the additional feedback @koke , ready for another pass. |
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 can't find color definition on the original issue (wordpress-mobile/gutenberg-mobile#479) or on the other PR (#17943). Anyway, the end results looks good to me. If the color scheme have to be changed, it can be done in a follow up PR.
Addressed with 92d7e71. I set the light-mode icon color to Screenshots:
|
This PR already has a 👍 and checked in with @koke too and he's fine with the PR state. The colors should be OK now @iamthomasbishop, but if they're not we can open a new PR really quickly, no problem. I'll merge this one as soon as the gutenberg-mobile side PR also gets the 👍. |
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.
Working great on iOS (dark and light) and Android.
@hypest Oops, I meant that |
Sorry for the confusion @iamthomasbishop , apparently I should have restarted the app inbetween mode switching for the proper colors to appear. Without changing the code, here are new screenshots taken:
|
After chatting with @iamthomasbishop over Slack, revised the light-mode color of the icon on the sheet to be
|
👋 @SergioEstevao , I know you've already 👍 'd the PR but, I added 0569a38 to fix the mobile tests (were failing on the gutenberg-mobile PR after e26a61b landed) and 973c2f8 to remove the hardcoded platform set and enable testing both platform so, can you have another pass please? Thanks! |
@SergioEstevao I had another look and all still looking good! |
(this is a follow up from #17943 and will copy and amend its description here. Recreated that PR so we merge it while @illusaen is temporarily away)
Description
Unsupported
block to show original block name.How has this been tested?
UnsupportedBlockEdit
)Screenshots
Types of changes
Checklist: