Skip to content

Commit

Permalink
Merge pull request silverstripe#478 from creative-commoners/pulls/1.2…
Browse files Browse the repository at this point in the history
…/preview-classes

NEW Allow Preview fill-height to be removed and add i18n to messages
  • Loading branch information
Damian Mooyman authored Apr 15, 2018
2 parents eb84d7b + 4ddee82 commit e61c429
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 198 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions client/src/components/Preview/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Preview extends Component {
className="btn btn-secondary font-icon-left-open-big toolbar__back-button hidden-lg-up"
type="button"
onClick={this.handleBackClick}
>Back</button>
>{i18n._t('Admin.BACK', 'Back')}</button>
);
}

Expand All @@ -85,7 +85,9 @@ class Preview extends Component {
if (!this.props.itemId) {
return (
<div className="preview__overlay">
<h3 className="preview__overlay-text">No preview available.</h3>
<h3 className="preview__overlay-text">
{i18n._t('Admin.NO_PREVIEW', 'No preview available.')}
</h3>
</div>
);
}
Expand All @@ -94,7 +96,9 @@ class Preview extends Component {
if (!previewUrl) {
return (
<div className="preview__overlay">
<h3 className="preview__overlay-text">There is no preview available for this item.</h3>
<h3 className="preview__overlay-text">
{i18n._t('Admin.NO_ITEM_PREVIEW', 'There is no preview available for this item.')}
</h3>
</div>
);
}
Expand All @@ -113,9 +117,11 @@ class Preview extends Component {
}

render() {
const className = classnames('flexbox-area-grow fill-height preview', this.props.className);
const { className } = this.props;

const classNames = classnames('preview', className);
return (
<div className={className}>
<div className={classNames}>
{this.renderBody()}
<div className="toolbar toolbar--south">
{ this.renderBackButton() }
Expand All @@ -130,11 +136,16 @@ class Preview extends Component {
}

Preview.propTypes = {
className: React.PropTypes.string,
itemLinks: React.PropTypes.object,
itemId: React.PropTypes.number,
onBack: React.PropTypes.func,
moreActions: React.PropTypes.arrayOf(React.PropTypes.element),
moreActionsPopoverId: React.PropTypes.string,
};

Preview.defaultProps = {
className: 'flexbox-area-grow fill-height',
};

export default Preview;
Loading

0 comments on commit e61c429

Please sign in to comment.