From d8d562af691237bffa317c9d08e9d56386d471f8 Mon Sep 17 00:00:00 2001 From: Dominic Masters <dominic@domsplace.com> Date: Sun, 18 Mar 2018 14:21:56 +1100 Subject: [PATCH] if for children on body section --- public/components/sections/BodySection.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/public/components/sections/BodySection.jsx b/public/components/sections/BodySection.jsx index 436193a..03bd90d 100644 --- a/public/components/sections/BodySection.jsx +++ b/public/components/sections/BodySection.jsx @@ -18,13 +18,21 @@ class BodySection extends React.Component { } render() { + let children; + + if(this.props.children) { + children = ( + <div className="c-body-section__wrapper"> + {this.props.children} + </div> + ); + } + return ( <Section section="body" className={this.props.className}> <div className="c-section--style-body__inner"> { this.props.title } - <div className="c-body-section__wrapper"> - {this.props.children} - </div> + { children } </div> </Section> )