wix-style-react
Version:
wix-style-react
82 lines (62 loc) • 3.43 kB
JavaScript
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import WixComponent from '../BaseComponents/WixComponent';
import styles from './GenericModalLayout.scss';
var GenericModalLayout = function (_WixComponent) {
_inherits(GenericModalLayout, _WixComponent);
function GenericModalLayout() {
_classCallCheck(this, GenericModalLayout);
return _possibleConstructorReturn(this, (GenericModalLayout.__proto__ || Object.getPrototypeOf(GenericModalLayout)).apply(this, arguments));
}
_createClass(GenericModalLayout, [{
key: 'render',
value: function render() {
var _props = this.props,
fullscreen = _props.fullscreen,
header = _props.header,
content = _props.content,
footer = _props.footer;
var containerClassNames = classNames(styles.container, _defineProperty({}, styles.fullscreenContainer, fullscreen));
return React.createElement(
'div',
{
className: containerClassNames,
'data-fullscreen': Boolean(fullscreen)
},
React.createElement(
'div',
null,
header
),
React.createElement(
'div',
{ className: styles.content },
content
),
React.createElement(
'div',
null,
footer
)
);
}
}]);
return GenericModalLayout;
}(WixComponent);
export { GenericModalLayout as default };
GenericModalLayout.propTypes = {
header: PropTypes.node,
content: PropTypes.node,
footer: PropTypes.node,
fullscreen: PropTypes.bool
};
GenericModalLayout.defaultProps = {
fullscreen: false
};
GenericModalLayout.displayName = 'GenericModalLayout';