Skip to content

Commit

Permalink
Remove HideWhenChildBlocks. This will be added on a separate branch
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Apr 12, 2019
1 parent e2f745a commit 6f4e295
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
10 changes: 0 additions & 10 deletions packages/block-editor/src/components/inner-blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Determines the placeholder behaviour when the Block is initially inserted. You m
* For convenience two predefined appender components are exposed on `InnerBlocks` which can be consumed within the render function:
- `<InnerBlocks.ButtonBlockAppender />` - display a `+` (plus) icon inside a box which fills the Block preview. No default Block is inserted. Clicking the appender reveals the Block picker UI.
- `<InnerBlocks.DefaultBlockAppender />` - provides the default "auto-insert" functionality described above under `default`.
- `<InnerBlocks.HideWhenChildBlocks />` - will only render `children` if the instance of `InnerBlocks` has no child blocks (typically only at point of first insertion). Once a child Block is added the `children` will not be rendered (see example usage below)
* Consumers are also free to pass any valid render function which provides full
flexibility to define a bespoke appender

Expand All @@ -137,15 +136,6 @@ flexibility to define a bespoke appender
) }
/>

// Will only display `ButtonBlockAppender` when there are no child blocks present
<InnerBlocks
renderAppender={ () => (
<InnerBlocks.HideWhenChildBlocks>
<InnerBlocks.ButtonBlockAppender />
</InnerBlocks.HideWhenChildBlocks>
) }
/>

// Fully custom
<InnerBlocks
renderAppender={ () => (
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions packages/block-editor/src/components/inner-blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { compose } from '@wordpress/compose';
*/
import ButtonBlockAppender from './button-block-appender';
import DefaultBlockAppender from './default-block-appender';
import HideWhenChildBlocks from './hide-when-child-blocks';

/**
* Internal dependencies
Expand Down Expand Up @@ -173,7 +172,6 @@ InnerBlocks = compose( [
// Expose default appender placeholders as components.
InnerBlocks.DefaultBlockAppender = DefaultBlockAppender;
InnerBlocks.ButtonBlockAppender = ButtonBlockAppender;
InnerBlocks.HideWhenChildBlocks = HideWhenChildBlocks;

InnerBlocks.Content = withBlockContentContext(
( { BlockContent } ) => <BlockContent />
Expand Down

0 comments on commit 6f4e295

Please sign in to comment.