-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make abstract component for styling previews inside dropdowns
- Loading branch information
1 parent
c9ecef0
commit 5bc673e
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/block-editor/src/components/block-preview/dropdown-wrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* BlockPreviewDropdownWrapper provides styling so you can show Preview inside | ||
* Dropdown components. It expects BlockPreview as a single child. | ||
* | ||
* @param {Object} props Component props. | ||
* | ||
* @return {WPElement} Rendered element. | ||
*/ | ||
export default function BlockPreviewDropdownWrapper( { children } ) { | ||
return ( | ||
<div className="block-editor-block-preview__dropdown-wrapper"> | ||
<div className="block-editor-block-preview__dropdown-wrapper-title">{ __( 'Preview' ) }</div> | ||
{ children } | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters