diff --git a/packages/block-editor/src/components/post-card/index.js b/packages/block-editor/src/components/post-card/index.js index f5a56ab64..0f749d627 100644 --- a/packages/block-editor/src/components/post-card/index.js +++ b/packages/block-editor/src/components/post-card/index.js @@ -131,9 +131,7 @@ const Post = ( props ) => { metaBelowTitle = secondaryMeta; } - const media = ( - - ); + const media = !! post.featured_media ? : null; const buttons = (
diff --git a/packages/components/src/card/index.js b/packages/components/src/card/index.js index 6ddcea2c1..799d0b86a 100644 --- a/packages/components/src/card/index.js +++ b/packages/components/src/card/index.js @@ -1,4 +1,5 @@ import classnames from "classnames"; +import * as icons from '@novablocks/icons'; import { RawHTML } from '@wordpress/element'; import { TextPlaceholder } from '../index'; @@ -33,7 +34,7 @@ const Card = ( props ) => {
{ - ( ( showMedia && props.media ) || placeholder ) && + ( showMedia || placeholder ) &&
{ props.media }
@@ -161,10 +162,20 @@ const CardMedia = ( { children, placeholder } ) => { } ); + let content = children; + + if ( ! children && ! placeholder ) { + content = ( +
+ { icons.placeholder } +
+ ); + } + return (
- { children } + { content }
)