combine conditions for early return
This commit is contained in:
parent
ac60428bc9
commit
50bec181e1
|
@ -300,15 +300,13 @@ const CollectionSpecificControls = (
|
||||||
const withCollectionSpecificControls =
|
const withCollectionSpecificControls =
|
||||||
< T extends EditorBlock< T > >( BlockEdit: ElementType ) =>
|
< T extends EditorBlock< T > >( BlockEdit: ElementType ) =>
|
||||||
( props: ProductCollectionEditComponentProps ) => {
|
( props: ProductCollectionEditComponentProps ) => {
|
||||||
if ( ! isProductCollection( props.name ) ) {
|
if ( ! isProductCollection( props.name ) || ! props.isSelected ) {
|
||||||
return <BlockEdit { ...props } />;
|
return <BlockEdit { ...props } />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ props.isSelected && (
|
<CollectionSpecificControls { ...props } />
|
||||||
<CollectionSpecificControls { ...props } />
|
|
||||||
) }
|
|
||||||
<BlockEdit { ...props } />
|
<BlockEdit { ...props } />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue