Allowed sections to have custom classes

This commit is contained in:
2018-03-17 13:27:42 +11:00
parent 666bafe98a
commit f398448422

View File

@ -17,12 +17,14 @@ class Section extends React.Component {
} }
render() { render() {
let style = (this.props.section ? "c-section--style-"+this.props.section : ""); let clazz = "c-section";
let fullWidth = this.props.full ? "c-section--full-width" : "";
console.log(this.props); if(this.props.section) clazz += " c-section--style-"+this.props.section;
if(this.props.full) clazz += " c-section--full-width";
if(this.props.className) clazz += " " + this.props.className;
return ( return (
<section className={"c-section " + style + " " + fullWidth }> <section className={ clazz }>
{ this.props.children } { this.props.children }
</section> </section>
) )