This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,12 @@ import PropTypes from 'prop-types'
7
7
* The core Separator block from Gutenberg.
8
8
*
9
9
* @author WebDevStudios
10
- * @param props.props
11
- * @param {object } props The component attributes as props.
12
- * @param {string } props.className Optional classnames.
13
- * @param {string } props.anchor Optional anchor/id.
10
+ * @param {object } props The component attributes as props.
11
+ * @param {string } props.className Optional classnames.
12
+ * @param {string } props.anchor Optional anchor/id.
14
13
* @return {Element } The Separator component.
15
14
*/
16
- export default function BlockSeparator ( { props} ) {
17
- const { className, anchor} = props
18
-
15
+ export default function BlockSeparator ( { className, anchor} ) {
19
16
const isFullWidth =
20
17
( className && className . includes ( 'is-style-full-width' ) ) > 0 ? true : false
21
18
@@ -25,7 +22,6 @@ export default function BlockSeparator({props}) {
25
22
}
26
23
27
24
BlockSeparator . propTypes = {
28
- props : PropTypes . object . isRequired ,
29
25
className : PropTypes . string ,
30
26
anchor : PropTypes . string
31
27
}
Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ import PropTypes from 'prop-types'
7
7
* The core Spacer block from Gutenberg.
8
8
*
9
9
* @author WebDevStudios
10
- * @param props.props
11
- * @param {object } props The component attributes as props.
12
- * @param {string } props.anchor Optional anchor/id.
13
- * @param {string } props.height The height of the spacer.
10
+ * @param {object } props The component attributes as props.
11
+ * @param {string } props.anchor Optional anchor/id.
12
+ * @param {number } props.height The height of the spacer.
14
13
* @return {Element } The Spacer component.
15
14
*/
16
- export default function BlockSpacer ( { props} ) {
17
- const { anchor, height} = props
15
+ export default function BlockSpacer ( { anchor, height} ) {
18
16
return < Spacer pxHeight = { height } id = { anchor } />
19
17
}
20
18
21
19
BlockSpacer . propTypes = {
22
- props : PropTypes . object . isRequired ,
23
20
anchor : PropTypes . string ,
24
21
height : PropTypes . number
25
22
}
23
+ BlockSpacer . defaultProps = {
24
+ anchor : 50
25
+ }
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ export default function displayBlock(block, index) {
35
35
case 'core/paragraph' :
36
36
return < Blocks . BlockParagraph props = { attributes } key = { index } />
37
37
case 'core/separator' :
38
- return < Blocks . BlockSeparator props = { attributes } key = { index } />
38
+ return < Blocks . BlockSeparator { ... attributes } key = { index } />
39
39
case 'core/shortcode' :
40
40
return < Blocks . BlockShortcode props = { attributes } key = { index } />
41
41
case 'core/spacer' :
42
- return < Blocks . BlockSpacer props = { attributes } key = { index } />
42
+ return < Blocks . BlockSpacer { ... attributes } key = { index } />
43
43
default :
44
44
return < pre key = { index } > { JSON . stringify ( attributes , null , 2 ) } </ pre >
45
45
}
You can’t perform that action at this time.
0 commit comments