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:
parent
e3fc757b3b
commit
92850b0823
1 changed files with 5 additions and 3 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue