Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Spinner,
ToolbarButton,
ToolbarGroup,
Tooltip,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import {
Expand All @@ -29,6 +30,7 @@ import {
} from '@wordpress/block-editor';
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
import { parse, cloneBlock } from '@wordpress/blocks';
import { lock, Icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -348,18 +350,29 @@ export default function ReusableBlockEdit( {

return (
<RecursionProvider uniqueId={ ref }>
{ userCanEdit && editOriginalProps && (
<BlockControls>
<ToolbarGroup>
<BlockControls group="other">
<ToolbarGroup>
{ userCanEdit && editOriginalProps && (
<ToolbarButton
href={ editOriginalProps.href }
onClick={ handleEditOriginal }
>
{ __( 'Edit original' ) }
</ToolbarButton>
</ToolbarGroup>
</BlockControls>
) }
) }
{ ! userCanEdit && (
<Tooltip
text={ __(
'You do not have permission to edit the content of this block'
) }
>
<div className="components-button components-toolbar-button has-icon">
<Icon icon={ lock } />
</div>
</Tooltip>
) }
</ToolbarGroup>
</BlockControls>

{ hasOverridableBlocks && (
<BlockControls>
Expand Down