import React from "react"; import format from "date-fns/format"; export default class PostPreview extends React.Component { render() { const {entry, getAsset, widgetFor} = this.props; let image = getAsset(entry.getIn(["data", "image"])); // Bit of a nasty hack to make relative paths work as expected as a background image here if (image && !image.fileObj) { image = window.parent.location.protocol + "//" + window.parent.location.host + image; } return

{ entry.getIn(["data", "title"]) }

{entry.getIn(["data", "intro", "heading"])}

{entry.getIn(["data", "intro", "description"])}

{(entry.getIn(["data","intro", "blurbs"]) || []).map((blurb, index) =>

{blurb.get("text")}

)}

{entry.getIn(["data", "main", "heading"])}

{entry.getIn(["data", "main", "description"])}

{(entry.getIn(['data', 'testimonials']) || []).map((testimonial, index) =>

“{testimonial.get('quote')}”

{testimonial.get('author')}
)}

{entry.getIn(['data', 'pricing', 'heading'])}

{entry.getIn(['data', 'pricing', 'description'])}

{(entry.getIn(['data', 'pricing', 'plans']) || []).map((plan, index) =>

{plan.get('plan')}

${plan.get('price')}

-

{plan.get('description')}

    {(plan.get('items') || []).map((item, index) =>
  • {item}

  • )}
)}
; } }