diff --git a/build/components/hero.js b/build/components/hero.js index 9b868bc..5e8c09b 100644 --- a/build/components/hero.js +++ b/build/components/hero.js @@ -21,6 +21,8 @@ var _classnames2 = _interopRequireDefault(_classnames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -40,13 +42,18 @@ var Hero = exports.Hero = function (_React$Component) { key: "render", value: function render() { var _style = {}; - if (this.props.backgroundImage) { - _style.backgroundImage = "url(" + this.props.backgroundImage + ")"; + + var _props = this.props, + backgroundImage = _props.backgroundImage, + otherProps = _objectWithoutProperties(_props, ["backgroundImage"]); + + if (backgroundImage) { + _style.backgroundImage = "url(" + backgroundImage + ")"; } var _className = (0, _classnames2.default)("neal-hero jumbotron jumbotron-fluid", this.props.className); return _react2.default.createElement( "div", - _extends({}, this.props, { className: _className, style: _style }), + _extends({}, otherProps, { className: _className, style: _style }), _react2.default.createElement( _bootstrap.Container, null, diff --git a/build/components/section.js b/build/components/section.js index 7841d14..0f3c853 100644 --- a/build/components/section.js +++ b/build/components/section.js @@ -19,6 +19,8 @@ var _classnames2 = _interopRequireDefault(_classnames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -38,16 +40,21 @@ var Section = exports.Section = function (_React$Component) { key: "render", value: function render() { var _className = (0, _classnames2.default)("neal-section", this.props.className); + + var _props = this.props, + heading = _props.heading, + otherProps = _objectWithoutProperties(_props, ["heading"]); + return _react2.default.createElement( "div", - _extends({}, this.props, { className: _className }), + _extends({}, otherProps, { className: _className }), _react2.default.createElement( "div", { className: "container" }, - this.props.heading ? _react2.default.createElement( + heading ? _react2.default.createElement( "h2", null, - this.props.heading + heading ) : null, this.props.children ) diff --git a/js/components/hero.jsx b/js/components/hero.jsx index 56f90d7..0722313 100644 --- a/js/components/hero.jsx +++ b/js/components/hero.jsx @@ -10,12 +10,13 @@ export class Hero extends React.Component { render() { const _style = {}; - if (this.props.backgroundImage) { - _style.backgroundImage = `url(${this.props.backgroundImage})`; + const { backgroundImage, ...otherProps } = this.props; + if (backgroundImage) { + _style.backgroundImage = `url(${backgroundImage})`; } const _className = classNames("neal-hero jumbotron jumbotron-fluid", this.props.className); return ( -