Skip to content

Commit

Permalink
Remove undefined className argument from save() methods. (#11605)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean90 authored Nov 8, 2018
1 parent 69427ea commit 5728b36
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docs/blocks/applying-styles-with-stylesheets.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ registerBlockType( 'gutenberg-boilerplate-es5/hello-world-step-02', {
return el( 'p', { className: props.className }, 'Hello editor.' );
},

save: function( props ) {
return el( 'p', { className: props.className }, 'Hello saved content.' );
save: function() {
return el( 'p', {}, 'Hello saved content.' );
}
} );
```
Expand All @@ -41,8 +41,8 @@ registerBlockType( 'gutenberg-boilerplate-esnext/hello-world-step-02', {
return <p className={ className }>Hello editor.</p>;
},

save( { className } ) {
return <p className={ className }>Hello saved content.</p>;
save() {
return <p>Hello saved content.</p>;
}
} );
```
Expand Down
3 changes: 1 addition & 2 deletions docs/blocks/block-controls-toolbars-and-inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,11 @@ registerBlockType( 'gutenberg-boilerplate-esnext/hello-world-step-04', {
);
},

save( { attributes, className } ) {
save( { attributes } ) {
const { content, alignment } = attributes;

return (
<RichText.Content
className={ className }
style={ { textAlign: alignment } }
value={ content }
tagName="p"
Expand Down
3 changes: 1 addition & 2 deletions docs/blocks/introducing-attributes-and-editable-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,12 @@ registerBlockType( 'gutenberg-boilerplate-esnext/hello-world-step-03', {
);
},

save( { attributes, className } ) {
save( { attributes } ) {
const { content } = attributes;

return (
<RichText.Content
tagName="p"
className={ className }
value={ content }
/>
);
Expand Down
6 changes: 2 additions & 4 deletions packages/block-library/src/cover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export const settings = {
}
),

save( { attributes, className } ) {
save( { attributes } ) {
const {
align,
backgroundType,
Expand All @@ -396,7 +396,6 @@ export const settings = {
}

const classes = classnames(
className,
dimRatioToClass( dimRatio ),
overlayColorClass,
{
Expand Down Expand Up @@ -470,11 +469,10 @@ export const settings = {
},
},

save( { attributes, className } ) {
save( { attributes } ) {
const { url, title, hasParallax, dimRatio, align } = attributes;
const style = backgroundImageStyles( url );
const classes = classnames(
className,
dimRatioToClass( dimRatio ),
{
'has-background-dim': dimRatio !== 0,
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/subhead/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ export const settings = {
);
},

save( { attributes, className } ) {
save( { attributes } ) {
const { align, content } = attributes;

return (
<RichText.Content
tagName="p"
className={ className }
style={ { textAlign: align } }
value={ content }
/>
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/verse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ export const settings = {
);
},

save( { attributes, className } ) {
save( { attributes } ) {
const { textAlign, content } = attributes;

return (
<RichText.Content
tagName="pre"
className={ className }
style={ { textAlign: textAlign } }
value={ content }
/>
Expand Down

0 comments on commit 5728b36

Please sign in to comment.