From bec138a1a427f73481597268f7e527c352c9b364 Mon Sep 17 00:00:00 2001 From: Ramon Date: Thu, 31 Oct 2024 13:48:06 +1100 Subject: [PATCH] PostTaxonomiesFlatTermSelector: abstract wrapper component (#66625) Co-authored-by: ramonjd Co-authored-by: kevin940726 --- .../post-taxonomies/flat-term-selector.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/editor/src/components/post-taxonomies/flat-term-selector.js b/packages/editor/src/components/post-taxonomies/flat-term-selector.js index 21a62c9819026d..cd9377766af503 100644 --- a/packages/editor/src/components/post-taxonomies/flat-term-selector.js +++ b/packages/editor/src/components/post-taxonomies/flat-term-selector.js @@ -57,6 +57,13 @@ const termNamesToIds = ( names, terms ) => { .filter( ( id ) => id !== undefined ); }; +const Wrapper = ( { children, __nextHasNoMarginBottom } ) => + __nextHasNoMarginBottom ? ( + { children } + ) : ( + { children } + ); + /** * Renders a flat term selector component. * @@ -292,15 +299,8 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) { singularName ); - const Wrapper = ( { children } ) => - __nextHasNoMarginBottom ? ( - { children } - ) : ( - { children } - ); - return ( - +