From 6be69ed1f77ca5d98523d8dfba623f4b5bb16622 Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Tue, 6 Aug 2019 02:05:08 +0200 Subject: [PATCH] Also fall back to image URL in PostList --- src/components/PostList.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/PostList.js b/src/components/PostList.js index aff7b01..50ce3df 100644 --- a/src/components/PostList.js +++ b/src/components/PostList.js @@ -12,12 +12,29 @@ export default class PostList extends React.Component {

{title}

{posts.map(({ node: post }) => ( - + {post.featured_media && post.featured_media.localFile && (
- + {post.featured_media.localFile.childImageSharp ? ( + + ) : ( + {post.featured_media.caption + )}
)}