Skip to content

Commit

Permalink
Show help icon only if block instructions differ from section instruc…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
avoinea committed Jun 24, 2021
1 parent 26b99ae commit a4ca4e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/manage/Blocks/Group/EditBlockWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ class EditBlockWrapper extends React.Component {
? data.required
: includes(config.blocks.requiredBlocks, type);

// Get editing instructions from block settings or props
let instructions = data?.instructions?.data || data?.instructions;
if (!instructions || instructions === '<p><br/></p>') {
instructions = '';
}

return (
<div ref={this.blockNode}>
<div
Expand All @@ -104,7 +110,7 @@ class EditBlockWrapper extends React.Component {
)}
{visible && (
<div className="block-toolbar">
{extraControls}
{instructions ? extraControls : ''}

{!disabled && (
<>
Expand Down

0 comments on commit a4ca4e5

Please sign in to comment.