Fix query for blog posts and featured image, add img package
This commit is contained in:
@@ -7,15 +7,19 @@ class Blog extends Component {
|
||||
render() {
|
||||
const data = this.props.data
|
||||
return (
|
||||
<div>
|
||||
<h1>Blog Posts</h1>
|
||||
<div className="flex">
|
||||
{data.allWordpressPost.edges.map(({ node }) => (
|
||||
<Card
|
||||
key={node.id}
|
||||
url={`blog/${node.slug}`}
|
||||
title={node.title}
|
||||
postId={node.id}
|
||||
date={node.date}
|
||||
excerpt={node.excerpt}
|
||||
image={
|
||||
node.featured_media
|
||||
? node.featured_media.localFile.childImageSharp.resolutions
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user