From 16b52bcd55a9642b78e550c492c349f9e8b0f537 Mon Sep 17 00:00:00 2001 From: Laurel Fulford Date: Mon, 11 May 2020 11:56:51 -0700 Subject: [PATCH] feat: add image shape classes to the front end --- src/blocks/homepage-articles/edit.js | 2 +- src/blocks/homepage-articles/view.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blocks/homepage-articles/edit.js b/src/blocks/homepage-articles/edit.js index 6cbf61715..0e145f8ec 100644 --- a/src/blocks/homepage-articles/edit.js +++ b/src/blocks/homepage-articles/edit.js @@ -508,7 +508,7 @@ class Edit extends Component { [ `image-align${ mediaPosition }` ]: showImage, [ `is-${ imageScale }` ]: imageScale !== '1' && showImage, 'mobile-stack': mobileStack, - [ `image-shape${ imageShape }` ]: imageShape !== 'landscape', + [ `is-${ imageShape }` ]: showImage, 'has-text-color': textColor.color !== '', 'show-caption': showCaption, 'show-category': showCategory, diff --git a/src/blocks/homepage-articles/view.php b/src/blocks/homepage-articles/view.php index 4e8d3d977..40a6c3dcf 100644 --- a/src/blocks/homepage-articles/view.php +++ b/src/blocks/homepage-articles/view.php @@ -35,6 +35,9 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) { if ( $attributes['showImage'] && isset( $attributes['imageScale'] ) ) { $classes .= ' is-' . $attributes['imageScale']; } + if ( $attributes['showImage'] ) { + $classes .= ' is-' . $attributes['imageShape']; + } if ( $attributes['showImage'] && $attributes['mobileStack'] ) { $classes .= ' mobile-stack'; }