1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Add missing image path to image widget

This commit is contained in:
Markus Grigull 2017-08-19 14:44:40 +02:00
parent e3fc757b3b
commit 92850b0823

View file

@ -38,13 +38,15 @@ class WidgetImage extends React.Component {
}
render() {
let file = this.props.files.find(file => file._id === this.props.widget.file);
const file = this.props.files.find(file => file._id === this.props.widget.file);
return (
<div className="full">
{file &&
{file ? (
<img className="full" alt={file.name} src={'/' + config.publicPathBase + file.path} onDragStart={e => e.preventDefault()} />
}
) : (
<img className="full" alt="missing-image" src={'/' + config.publicPathBase + 'missing-image.png'} onDragStart={e => e.preventDefault()} />
)}
</div>
);
}