unfortunately I can test this in dev...
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
class PrefixedImageControl extends React.Component {
|
||||
(function waitForCMSAndReact() {
|
||||
if (!(window.CMS && window.React)) {
|
||||
setTimeout(waitForCMSAndReact, 50);
|
||||
return;
|
||||
}
|
||||
const React = window.React;
|
||||
|
||||
class PrefixedImageControl extends React.Component {
|
||||
openMediaLibrary = () => {
|
||||
this.props.mediaLibrary.open({
|
||||
allowMultiple: false,
|
||||
@@ -31,17 +38,18 @@ class PrefixedImageControl extends React.Component {
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const PrefixedImageWidget = {
|
||||
const PrefixedImageWidget = {
|
||||
name: "prefixed-image",
|
||||
controlComponent: PrefixedImageControl,
|
||||
previewComponent: ({ value }) =>
|
||||
value ? React.createElement("img", { src: value, alt: "", style: { maxWidth: "200px" } }) : null,
|
||||
};
|
||||
};
|
||||
|
||||
window.CMS.registerWidget(
|
||||
window.CMS.registerWidget(
|
||||
PrefixedImageWidget.name,
|
||||
PrefixedImageWidget.controlComponent,
|
||||
PrefixedImageWidget.previewComponent
|
||||
);
|
||||
);
|
||||
})();
|
||||
Reference in New Issue
Block a user