Skip to content

Commit

Permalink
PostTaxonomiesFlatTermSelector: abstract wrapper component (WordPress…
Browse files Browse the repository at this point in the history
…#66625)

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: kevin940726 <[email protected]>
  • Loading branch information
3 people authored and karthick-murugan committed Nov 13, 2024
1 parent b48dd4e commit 15b1802
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ const termNamesToIds = ( names, terms ) => {
.filter( ( id ) => id !== undefined );
};

const Wrapper = ( { children, __nextHasNoMarginBottom } ) =>
__nextHasNoMarginBottom ? (
<VStack spacing={ 4 }>{ children }</VStack>
) : (
<Fragment>{ children }</Fragment>
);

/**
* Renders a flat term selector component.
*
Expand Down Expand Up @@ -292,15 +299,8 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
singularName
);

const Wrapper = ( { children } ) =>
__nextHasNoMarginBottom ? (
<VStack spacing={ 4 }>{ children }</VStack>
) : (
<Fragment>{ children }</Fragment>
);

return (
<Wrapper>
<Wrapper __nextHasNoMarginBottom={ __nextHasNoMarginBottom }>
<FormTokenField
__next40pxDefaultSize
value={ values }
Expand Down

0 comments on commit 15b1802

Please sign in to comment.