Skip to content

Commit

Permalink
feat: add blockGap support to Comment Template
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Feb 24, 2025
1 parent cca7615 commit cc9ccfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Contains the block elements used to display a comment, like the title, date, aut
- **Name:** core/comment-template
- **Category:** design
- **Parent:** core/comments
- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** align, interactivity (clientNavigation), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~

## Comments

Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/comment-template/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
"align": true,
"html": false,
"reusable": false,
"layout": true,
"spacing": {
"margin": true,
"padding": true
"padding": true,
"blockGap": {
"__experimentalDefault": "1.25em"
}
},
"typography": {
"fontSize": true,
Expand Down
5 changes: 3 additions & 2 deletions packages/block-library/src/comment-template/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function CommentTemplateInnerBlocks( {
} ) {
const { children, ...innerBlocksProps } = useInnerBlocksProps(
{},
{ template: TEMPLATE }
{ template: TEMPLATE, __unstableDisableLayoutClassNames: true }
);

return (
Expand Down Expand Up @@ -241,8 +241,9 @@ const CommentsList = ( {
export default function CommentTemplateEdit( {
clientId,
context: { postId },
__unstableLayoutClassNames: layoutClassNames,
} ) {
const blockProps = useBlockProps();
const blockProps = useBlockProps( { className: layoutClassNames } );

const [ activeCommentId, setActiveCommentId ] = useState();
const {
Expand Down

0 comments on commit cc9ccfb

Please sign in to comment.