@quillforms/blocklib-welcome-screen-block
Version:
Welcome screen block for quillforms
48 lines (47 loc) • 1.89 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _classnames = _interopRequireDefault(require("classnames"));
var _emotion = require("emotion");
const Attachment = ({
attributes,
isPreview
}) => {
return (0, _react.createElement)("div", {
className: (0, _classnames.default)('renderer-core-block-attachment', (0, _emotion.css)`
${attributes.layout !== 'split-right' && attributes.layout !== 'split-left' && `
max-width: ${attributes?.attachmentMaxWidth};
margin: auto;
text-align: center;
`}
overflow: hidden;
`)
}, attributes.attachment && attributes.attachment.url ? (0, _react.createElement)("img", {
alt: '',
src: attributes.attachment.url,
className: (0, _classnames.default)('renderer-core-block-attachment__image', (0, _emotion.css)`
${attributes.layout !== 'split-right' && attributes.layout !== 'split-left' && `border-radius: ${attributes.attachmentBorderRadius};
margin: auto;
`}
`)
}) : (0, _react.createElement)(_react.Fragment, null, isPreview && (0, _react.createElement)("div", {
className: "renderer-core-block-attachment__placeholder"
}, (0, _react.createElement)("svg", {
className: "renderer-core-block-attachment__placeholder-icon",
focusable: "false",
viewBox: "0 0 24 24",
role: "presentation"
}, (0, _react.createElement)("circle", {
cx: "12",
cy: "12",
r: "3.2"
}), (0, _react.createElement)("path", {
d: "M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"
})))));
};
var _default = exports.default = Attachment;
//# sourceMappingURL=attachment.js.map