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