Skip to content

Commit

Permalink
Switch allowedBlocks to attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaz committed Apr 13, 2021
1 parent bbd3333 commit 583d6fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/social-links/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"name": "core/social-links",
"category": "widgets",
"attributes": {
"allowedBlocks": {
"type": "array",
"default": [ "core/social-link" ]
},
"iconColor": {
"type": "string"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/block-library/src/social-links/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import {
import { __ } from '@wordpress/i18n';
import { check } from '@wordpress/icons';

const ALLOWED_BLOCKS = [ 'core/social-link' ];

const sizeOptions = [
{ name: __( 'Small' ), value: 'has-small-icon-size' },
{ name: __( 'Normal' ), value: 'has-normal-icon-size' },
Expand All @@ -51,6 +49,7 @@ export function SocialLinksEdit( props ) {
} = props;

const {
allowedBlocks,
iconBackgroundColorValue,
iconColorValue,
itemsJustification,
Expand Down Expand Up @@ -93,7 +92,7 @@ export function SocialLinksEdit( props ) {

const blockProps = useBlockProps( { className } );
const innerBlocksProps = useInnerBlocksProps( blockProps, {
allowedBlocks: ALLOWED_BLOCKS,
allowedBlocks,
orientation: 'horizontal',
placeholder: SocialPlaceholder,
templateLock: false,
Expand Down

0 comments on commit 583d6fb

Please sign in to comment.