33 lines
856 B
JavaScript
33 lines
856 B
JavaScript
|
|
var DashImage;
|
||
|
|
export default window.DashImage = DashImage = class DashImage extends React.Component {
|
||
|
|
constructor(props) {
|
||
|
|
super(props);
|
||
|
|
}
|
||
|
|
|
||
|
|
render() {
|
||
|
|
var className, link, style;
|
||
|
|
className = ["img", this.props.ratio != null ? "pb-" + this.props.ratio : void 0, this.props.height != null ? " " + this.props.height : void 0].join(" ");
|
||
|
|
style = {
|
||
|
|
backgroundImage: 'url(' + this.props.image + ')'
|
||
|
|
};
|
||
|
|
link = this.props.link;
|
||
|
|
|
||
|
|
if (this.props.image != null) {
|
||
|
|
if (link != null) {
|
||
|
|
return /*#__PURE__*/React.createElement("a", {
|
||
|
|
href: link,
|
||
|
|
className: className,
|
||
|
|
style: style
|
||
|
|
});
|
||
|
|
} else {
|
||
|
|
return /*#__PURE__*/React.createElement("div", {
|
||
|
|
className: className,
|
||
|
|
style: style
|
||
|
|
});
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
};
|