Skip to content

Commit

Permalink
Update post preview template
Browse files Browse the repository at this point in the history
  • Loading branch information
biilmann committed Oct 20, 2017
1 parent 6b46d89 commit 2db9a63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/cms-preview-templates/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import format from "date-fns/format";

export default class PostPreview extends React.Component {
render() {
const {entry, widgetFor} = this.props;
const {entry, widgetFor, getAsset} = this.props;
let image = getAsset(entry.getIn(["data", "image"]));

return <div className="mw6 center ph3 pv4">
<h1 className="f2 lh-title b mb3">{ entry.getIn(["data", "title"])}</h1>
Expand All @@ -16,6 +17,8 @@ export default class PostPreview extends React.Component {
<p>Read in x minutes</p>
</div>
<div className="cms mw6">
<p>{ entry.getIn(["data", "description"]) }</p>
{ image && <img src={ image } alt={ entry.getIn(["data", "title"])} /> }
{ widgetFor("body") }
</div>
</div>;
Expand Down

0 comments on commit 2db9a63

Please sign in to comment.