22 * Separator
33 */
44
5- /**
6- * WordPress dependencies
7- */
8- import { Component } from '@wordpress/element' ;
9-
105/**
116 * Internal dependencies
127 */
@@ -17,27 +12,20 @@ import './style.scss';
1712 */
1813import classNames from 'classnames' ;
1914
20- class Separator extends Component {
21- /**
22- * Render
23- */
24- render ( ) {
25- const { alignment = 'full-width' , className, marginBottom = 64 , marginTop = 64 , variant = 'tertiary' , ...otherProps } = this . props ;
26-
27- const classes = classNames (
28- 'newspack-separator' ,
29- className ,
30- alignment && `newspack-separator--alignment-${ alignment } ` ,
31- variant && `newspack-separator--variant-${ variant } `
32- ) ;
33-
34- const style = {
35- '--separator-margin-bottom' : typeof marginBottom === 'number' ? `${ marginBottom } px` : marginBottom ,
36- '--separator-margin-top' : typeof marginTop === 'number' ? `${ marginTop } px` : marginTop ,
37- } ;
38-
39- return < hr className = { classes } style = { style } { ...otherProps } /> ;
40- }
41- }
15+ const Separator = ( { alignment = 'full-width' , className, marginBottom = 64 , marginTop = 64 , variant = 'tertiary' , ...otherProps } ) => {
16+ const classes = classNames (
17+ 'newspack-separator' ,
18+ className ,
19+ alignment && `newspack-separator--alignment-${ alignment } ` ,
20+ variant && `newspack-separator--variant-${ variant } `
21+ ) ;
22+
23+ const style = {
24+ '--separator-margin-bottom' : typeof marginBottom === 'number' ? `${ marginBottom } px` : marginBottom ,
25+ '--separator-margin-top' : typeof marginTop === 'number' ? `${ marginTop } px` : marginTop ,
26+ } ;
27+
28+ return < hr className = { classes } style = { style } { ...otherProps } /> ;
29+ } ;
4230
4331export default Separator ;
0 commit comments