Skip to content

Commit

Permalink
Have a image placeholder while image size is being calculated. (#13777)
Browse files Browse the repository at this point in the history
* Have a image placeholder while image size is being calculated.

* Move placeholder image to image block code.
  • Loading branch information
SergioEstevao authored and youknowriad committed Mar 6, 2019
1 parent 666ec9e commit 439d390
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ class ImageEdit extends React.Component {
imageHeightWithinContainer,
} = sizes;

if ( imageWidthWithinContainer === undefined ) {
return (
<View style={ styles.imageContainer } >
<Dashicon icon={ 'format-image' } size={ 300 } />
</View>
);
}

let finalHeight = imageHeightWithinContainer;
if ( height > 0 && height < imageHeightWithinContainer ) {
finalHeight = height;
Expand Down

0 comments on commit 439d390

Please sign in to comment.