dm-web-react
Version:
The DM web client with React.
45 lines • 2.25 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import * as React from "react";
import * as ReactModal from "react-modal";
import { withTheme } from "styled-components";
ReactModal.setAppElement("body");
var Modal = /** @class */ (function (_super) {
__extends(Modal, _super);
function Modal(props) {
var _this = _super.call(this, props) || this;
_this.modalStyles = {
content: __assign({ margin: "auto", padding: "0px", width: props.width || "400px", height: props.height || "auto", border: "none", borderRadius: "4px", background: "#2D2F38", boxShadow: "0 9px 9px 0 rgba(0,0,0,0.10), 0 3px 3px 0 rgba(0,0,0,0.10), 0 1px 1px 0 rgba(0,0,0,0.10)", boxSizing: "border-box", display: "flex", flexDirection: "column", position: "relative", top: "0", right: "0", bottom: "0", left: "0" }, props.contentStyles),
overlay: __assign({ display: "flex", backgroundColor: "rgba(33,35,41,0.70)", overflow: "auto", zIndex: 999 }, props.overlayStyles),
};
return _this;
}
Modal.prototype.render = function () {
return React.createElement(ReactModal, __assign({}, this.props, { style: this.modalStyles }));
};
return Modal;
}(React.PureComponent));
export default withTheme(Modal);
//# sourceMappingURL=Modal.js.map