-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add block description component #1555
Conversation
</div> | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it but this could be a functional component, no need for a class.
@@ -0,0 +1,21 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this component should be moved to the blocks
module next to the BlockControls
, InspectorControls
, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually tested it as a functional component in that folder at first but wasn't sure if it's correct / the best approach. Happy to move it.
@youknowriad It's now a functional component just like you suggested. |
This is a great idea, looking forward to it being merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Thanks! |
Is there a reason this is a component and not just a localized property string of the block settings, similar to its |
IIRC we discussed that a plain-text property string could be used for something else instead, like short descriptions somewhere à la |
@StaggerLeee That sounds like something that could be applied to other areas as well. Would you mind creating a new issue for this? Thanks! |
Hi @swissspidy, it is here: |
This is something that came up in #1440, #1467, and #1545.
The component is actually quite simple and could be added to the inspector like this:
Now, when there are other components after it, it looks like this:
As you can see, there's a thin border being added. If it's the only component, it looks like this:
Perhaps the border should be added manually using an attribute or a
<hr />
, not sure what's the best approach.Feedback welcome.