wix-style-react
Version:
64 lines (49 loc) • 2.52 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import React from 'react';
import PropTypes from 'prop-types';
import { st, classes } from './Content.st.css';
import { dataHooks } from '../constants';
var Content = /*#__PURE__*/function (_React$PureComponent) {
_inherits(Content, _React$PureComponent);
var _super = _createSuper(Content);
function Content() {
_classCallCheck(this, Content);
return _super.apply(this, arguments);
}
_createClass(Content, [{
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
className = _this$props.className,
noPadding = _this$props.noPadding;
return /*#__PURE__*/React.createElement("div", {
className: st(classes.root, {
noPadding: noPadding
}, className),
"data-hook": dataHooks.sidePanelContent
}, children);
}
}]);
return Content;
}(React.PureComponent);
_defineProperty(Content, "displayName", 'Content');
_defineProperty(Content, "propTypes", {
/** Define styles through a classname */
className: PropTypes.string,
/** Any element to be rendered inside under title */
children: PropTypes.node,
/** Remove paddings from the content */
noPadding: PropTypes.bool
});
_defineProperty(Content, "defaultProps", {
noPadding: false
});
export default Content;