Skip to content

Commit

Permalink
PostTaxonomiesFlatTermSelector: abstract wrapper component (#66625)
Browse files Browse the repository at this point in the history
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: kevin940726 <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent beae8ad commit bf08f06
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 bf08f06

Please sign in to comment.