fixed import and jsx
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 39s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 39s
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
class PrefixedImageControl extends React.Component {
|
class PrefixedImageControl extends React.Component {
|
||||||
openMediaLibrary = () => {
|
openMediaLibrary = () => {
|
||||||
this.props.mediaLibrary.open({
|
this.props.mediaLibrary.open({
|
||||||
@@ -25,12 +23,12 @@ class PrefixedImageControl extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const value = this.props.value || "";
|
const value = this.props.value || "";
|
||||||
return (
|
return (
|
||||||
<div>
|
React.createElement("div", null,
|
||||||
<button type="button" onClick={this.openMediaLibrary}>
|
React.createElement("button", { type: "button", onClick: this.openMediaLibrary },
|
||||||
{value ? "Change Image" : "Add Image"}
|
value ? "Change Image" : "Add Image"
|
||||||
</button>
|
),
|
||||||
{value && <img src={value} alt="" style={{ maxWidth: "200px", display: "block", marginTop: "1em" }} />}
|
value && React.createElement("img", { src: value, alt: "", style: { maxWidth: "200px", display: "block", marginTop: "1em" } })
|
||||||
</div>
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +37,7 @@ const PrefixedImageWidget = {
|
|||||||
name: "prefixed-image",
|
name: "prefixed-image",
|
||||||
controlComponent: PrefixedImageControl,
|
controlComponent: PrefixedImageControl,
|
||||||
previewComponent: ({ value }) =>
|
previewComponent: ({ value }) =>
|
||||||
value ? <img src={value} alt="" style={{ maxWidth: "200px" }} /> : null,
|
value ? React.createElement("img", { src: value, alt: "", style: { maxWidth: "200px" } }) : null,
|
||||||
};
|
};
|
||||||
|
|
||||||
window.CMS.registerWidget(
|
window.CMS.registerWidget(
|
||||||
|
|||||||
Reference in New Issue
Block a user