Skip to content
Permalink
Browse files

Do not show image preview if not an image

  • Loading branch information...
zackify committed Aug 3, 2018
1 parent f5b4873 commit 7a31b03ee42dcf55434f36db66aaa14509ea7d81
Showing with 2 additions and 2 deletions.
  1. +1 −1 controls/package.json
  2. +1 −1 controls/src/form/media-select.js
@@ -1,6 +1,6 @@
{
"name": "gutenblock-controls",
"version": "1.0.1",
"version": "1.0.2",
"description": "Useful inspector controls for gutenberg",
"main": "dist/index.js",
"scripts": {
@@ -3,7 +3,7 @@ const { MediaUpload } = wp.editor;

export default ({ name, attributes, onChange, beforeChange, label, ...props }) => (
<div style={{ display: 'flex' }}>
{attributes[name] ? (
{attributes[name] && !beforeChange ? (
<img src={attributes[name]} style={{ height: 10, marginRight: 5, alignSelf: 'center' }} />
) : null}
<MediaUpload

0 comments on commit 7a31b03

Please sign in to comment.
You can’t perform that action at this time.