Skip to content
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] Add a subtitle for unsupported blocks #18107

Merged
merged 2 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/block-library/src/missing/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ export class UnsupportedBlockEdit extends Component {
const title = blockType ? blockType.settings.title : __( 'Unsupported' );
const titleStyle = getStylesFromColorScheme( styles.unsupportedBlockMessage, styles.unsupportedBlockMessageDark );

const subTitleStyle = getStylesFromColorScheme( styles.unsupportedBlockSubtitle, styles.unsupportedBlockSubtitleDark );
const subtitle = blockType ? <Text style={ subTitleStyle }>{ __( 'Unsupported' ) }</Text> : null;
hypest marked this conversation as resolved.
Show resolved Hide resolved

const icon = blockType ? normalizeIconObject( blockType.settings.icon ) : 'admin-plugins';
const iconStyle = getStylesFromColorScheme( styles.unsupportedBlockIcon, styles.unsupportedBlockIconDark );
const iconClassName = 'unsupported-icon' + '-' + preferredColorScheme;
return (
<View style={ getStylesFromColorScheme( styles.unsupportedBlock, styles.unsupportedBlockDark ) }>
<Icon className={ iconClassName } icon={ icon && icon.src ? icon.src : icon } color={ iconStyle.color } />
<Text style={ titleStyle }>{ title }</Text>
{ subtitle }
</View>
);
}
Expand Down
14 changes: 13 additions & 1 deletion packages/block-library/src/missing/style.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@
}

.unsupportedBlockMessage {
margin-top: 2;
margin-top: 4;
text-align: center;
color: $gray-dark;
font-size: 14;
font-weight: 600;
}

.unsupportedBlockMessageDark {
color: $white;
}

.unsupportedBlockSubtitle {
margin-top: 2;
text-align: center;
color: $gray-darken-20;
font-size: 12;
}

.unsupportedBlockSubtitleDark {
color: $gray-20;
}