From 9a158d4ed687fbc47cd1fc4d0f08ce342876cc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:45:30 +0100 Subject: [PATCH] Templates: hide mediaField in list view if not provided (#66573) Co-authored-by: oandregal Co-authored-by: ntsekouras --- .../dataviews/src/dataviews-layouts/list/index.tsx | 12 +++++------- .../dataviews/src/dataviews-layouts/list/style.scss | 6 ------ .../edit-site/src/components/page-templates/index.js | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/dataviews/src/dataviews-layouts/list/index.tsx b/packages/dataviews/src/dataviews-layouts/list/index.tsx index 82f9b5ea4d4fc5..a4f94e482c69b3 100644 --- a/packages/dataviews/src/dataviews-layouts/list/index.tsx +++ b/packages/dataviews/src/dataviews-layouts/list/index.tsx @@ -176,10 +176,10 @@ function ListItem< Item >( { }, [ actions, item ] ); const renderedMediaField = mediaField?.render ? ( - - ) : ( -
- ); +
+ +
+ ) : null; const renderedPrimaryField = primaryField?.render ? ( @@ -248,9 +248,7 @@ function ListItem< Item >( { /> -
- { renderedMediaField } -
+ { renderedMediaField }