2016-04-18 06:48:07 +02:00
|
|
|
import React from 'react';
|
2016-04-21 11:59:44 +02:00
|
|
|
import SilverStripeComponent from 'lib/SilverStripeComponent';
|
2016-04-18 06:48:07 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the right-hand collapsable change preview panel
|
|
|
|
*/
|
2016-04-21 11:59:44 +02:00
|
|
|
class Preview extends SilverStripeComponent {
|
2016-04-18 06:48:07 +02:00
|
|
|
|
|
|
|
render() {
|
2016-04-27 04:26:39 +02:00
|
|
|
// @todo - Multiple preview views with toggle slider
|
|
|
|
let body = null;
|
|
|
|
if (this.props.previewUrl) {
|
|
|
|
body = <iframe className="preview__iframe" src={this.props.previewUrl}></iframe>;
|
|
|
|
} else {
|
|
|
|
body = (
|
2016-04-18 06:48:07 +02:00
|
|
|
<div className="preview__overlay">
|
|
|
|
<h3 className="preview__overlay-text">There is no preview available for this item.</h3>
|
|
|
|
</div>
|
2016-04-27 04:26:39 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<div className="cms-content__right preview">
|
|
|
|
{body}
|
2016-04-18 06:48:07 +02:00
|
|
|
<div className="preview__file-container panel-scrollable">
|
2016-04-27 04:26:39 +02:00
|
|
|
<img alt="placeholder" className="preview__file--fits-space" src="http://placehold.it/250x150" />
|
2016-04-18 06:48:07 +02:00
|
|
|
</div>
|
2016-04-27 04:26:39 +02:00
|
|
|
<a href="" className="cms-content__back-btn font-icon-left-open-big" />
|
2016-04-19 06:37:25 +02:00
|
|
|
<div className="toolbar--south">
|
2016-04-18 06:48:07 +02:00
|
|
|
<div className="btn-toolbar">
|
2016-04-27 04:26:39 +02:00
|
|
|
<button className="btn btn-secondary btn-secondary" type="button">
|
|
|
|
<i className="font-icon-edit" /> Edit
|
|
|
|
</button>
|
|
|
|
<button type="button" data-container="body" className="btn btn-link btn--options"
|
|
|
|
data-toggle="popover" title="Page actions" data-placement="top"
|
|
|
|
data-content="<a href=''>Add to campaign</a><a href=''>Remove from campaign</a>"
|
|
|
|
><i className="font-icon-dot-3" /></button>
|
2016-04-18 06:48:07 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-04-27 04:09:57 +02:00
|
|
|
|
2016-04-18 06:48:07 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-21 11:59:44 +02:00
|
|
|
export default Preview;
|