Skip to content

Commit

Permalink
Revert workaround for embed preview in native
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiddot committed Jul 1, 2021
1 parent 93def61 commit 9f14b7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 1 addition & 6 deletions packages/block-library/src/embed/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,7 @@ const EmbedEdit = ( props ) => {
return { fetching: false, cannotEmbed: false };
}

const embedPreview = Platform.select( {
web: getEmbedPreview( attributesUrl ),
// On the native version, the embed previews are not supported yet,
// so we return instead the URL as the preview.
native: attributesUrl,
} );
const embedPreview = getEmbedPreview( attributesUrl );
const previewIsFallback = isPreviewEmbedFallback( attributesUrl );

// The external oEmbed provider does not exist. We got no type info and no html.
Expand Down
6 changes: 4 additions & 2 deletions packages/block-library/src/embed/embed-preview.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const EmbedPreview = ( {
isSelected,
onBlur,
onFocus,
preview,
} ) => {
const [ isCaptionSelected, setIsCaptionSelected ] = useState( false );
const stylePlaceholder = usePreferredColorSchemeStyle(
Expand Down Expand Up @@ -70,7 +69,10 @@ const EmbedPreview = ( {
>
<View>
<View style={ stylePlaceholder }>
<Text style={ stylePlaceholderText }>{ preview }</Text>
<Text style={ stylePlaceholderText }>
Embed Preview will be directly above the Block Caption
component when it is implemented.
</Text>
</View>
<BlockCaption
accessibilityLabelCreator={ accessibilityLabelCreator }
Expand Down

0 comments on commit 9f14b7e

Please sign in to comment.