Restructuring of cards and styling blog

This commit is contained in:
Moris Zen
2018-07-06 12:56:09 +02:00
parent 8d435d1ce6
commit f4f78eae06
2 changed files with 20 additions and 24 deletions

View File

@@ -7,20 +7,22 @@ class Blog extends Component {
render() {
const data = this.props.data
return (
<div className="flex">
<div className="container mx-auto p-4 w-full md:flex md:flex-wrap items-stretch w-full">
{data.allWordpressPost.edges.map(({ node }) => (
<Card
key={node.id}
url={`blog/${node.slug}`}
title={node.title}
date={node.date}
excerpt={node.excerpt}
image={
node.featured_media
? node.featured_media.localFile.childImageSharp.resolutions
: undefined
}
/>
<div className="md:w-1/2 p-2">
<Card
key={node.id}
url={`blog/${node.slug}`}
title={node.title}
date={node.date}
excerpt={node.excerpt}
image={
node.featured_media
? node.featured_media.localFile.childImageSharp.resolutions
: undefined
}
/>
</div>
))}
</div>
)