fix ArticleCard to properly works with styled jsx. Image component inlined

This commit is contained in:
tmshv committed 2019-10-15 00:24:27 +03:00
1 parent 5831275b7a
commit d4f6568269
1 file changed
+9 -6
+9 -6
View File
@@ -1,5 +1,5 @@
import React from 'react'
import { Image } from './Image'
import cx from 'classnames'
import { dateFormat } from '../lib/date'
const Date = ({ children }) => (
@@ -102,11 +102,14 @@ export const ArticleCard = ({ article }) => (
<a className="invisible" href={article.url}>
<div className="ArticleCard-image">
{!article.preview ? null : (
<Image
data={article.preview}
alt={article.title}
opa={false}
/>
<picture>
<img
className={cx({ opa: false })}
alt={article.title}
src={article.preview.src}
srcSet={article.preview.set.map(({ url, density }) => `${url} ${density}x`)}
/>
</picture >
)}
</div>