src/layout/section.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styles from '../../build/styles';
import { getCallbacks } from '../helper/helper';
export default class Section extends Component {
static propTypes = {
children: PropTypes.any,
style: PropTypes.object,
className: PropTypes.string,
};
static defaultProps = {
style: {},
className: '',
};
createClassName() {
return [
styles.section,
this.props.className,
].join(' ').trim();
}
render() {
return (
<section
{...getCallbacks(this.props)}
className={this.createClassName()}
style={this.props.style}
>
{this.props.children}
</section>
);
}
}