Skip to content

Commit

Permalink
Lint fix and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonis Lilis committed Jul 23, 2020
1 parent df25f6b commit 054a6b5
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ const { Fill, Slot } = createSlotFill( 'InspectorControls' );
* Adds the block settings button when the inspector control has children
*
* In some cases we don't want to show the block settings button
* even if the the inspector controls have children. We can exclude
* those childen by passing the 'excludeFromSettings' prop
* (e.g. The color picker control of the Cover block is triggered
* by a separate swatch button)
* even if the the inspector controls have children. In such cased we can pass
* the 'hideBlockSettingsButton' prop (e.g. The color picker control of the
* Cover block is triggered by a separate swatch button)
* */
const FillWithSettingsButton = ( { children, ...props } ) => {
const { isSelected } = useBlockEditContext();
Expand All @@ -39,7 +38,10 @@ const FillWithSettingsButton = ( { children, ...props } ) => {
</BottomSheetConsumer>
}
</Fill>
{ ! props.hideBlockSettingsButton && React.Children.count( children ) > 0 && <BlockSettingsButton /> }
{ ! props.hideBlockSettingsButton &&
React.Children.count( children ) > 0 && (
<BlockSettingsButton />
) }
</>
);
};
Expand Down

0 comments on commit 054a6b5

Please sign in to comment.