Skip to content

Commit

Permalink
[RNMobile] Embed block: Add styles for error case (#33535)
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiddot authored Jul 20, 2021
1 parent 5aa3559 commit 3b85572
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/block-library/src/embed/embed-placeholder.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ const EmbedPlaceholder = ( {
styles.embed__label,
styles[ 'embed__label--dark' ]
);
const descriptionStyle = usePreferredColorSchemeStyle(
styles.embed__description,
styles[ 'embed__description--dark' ]
);
const descriptionStyle = styles.embed__description;
const descriptionErrorStyle = styles[ 'embed__description--error' ];
const actionStyle = usePreferredColorSchemeStyle(
styles.embed__action,
styles[ 'embed__action--dark' ]
Expand All @@ -43,6 +41,7 @@ const EmbedPlaceholder = ( {
styles.embed__icon,
styles[ 'embed__icon--dark' ]
);
const embedIconErrorStyle = styles[ 'embed__icon--error' ];

return (
<>
Expand All @@ -57,10 +56,15 @@ const EmbedPlaceholder = ( {
<>
<Icon
icon={ noticeOutline }
fill={ embedIconStyle.fill }
style={ styles[ 'embed__icon--error' ] }
fill={ embedIconErrorStyle.fill }
style={ embedIconErrorStyle }
/>
<Text style={ descriptionStyle }>
<Text
style={ [
descriptionStyle,
descriptionErrorStyle,
] }
>
{ __( 'Unable to embed media' ) }
</Text>
<Text style={ actionStyle }>
Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/embed/styles.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

.embed__icon--error {
margin-bottom: 6;
fill: $alert-red;
}

.embed__label {
Expand All @@ -55,6 +56,10 @@
color: $dark-secondary;
}

.embed__description--error {
color: $alert-red;
}

.embed__action {
width: 100%;
text-align: center;
Expand Down

0 comments on commit 3b85572

Please sign in to comment.