[www] ArticleCard clean: Image from component
This commit is contained in:
1 parent
39ce95746f
commit
f723724613
1 file changed
+1
-11
@@ -1,21 +1,11 @@
|
|||||||
const React = require('react')
|
const React = require('react')
|
||||||
const dateFormat = require('../lib/date').dateFormat
|
const dateFormat = require('../lib/date').dateFormat
|
||||||
|
const Image = require('./Image')
|
||||||
|
|
||||||
const Date = ({children}) => (
|
const Date = ({children}) => (
|
||||||
<p className="date">{dateFormat(children)}</p>
|
<p className="date">{dateFormat(children)}</p>
|
||||||
)
|
)
|
||||||
|
|
||||||
const Image = ({data, alt}) => (
|
|
||||||
<picture>
|
|
||||||
<img
|
|
||||||
className="opa"
|
|
||||||
alt={alt}
|
|
||||||
src={data.src}
|
|
||||||
srcSet={data.set.map(({url, density}) => `${url} ${density}x`)}
|
|
||||||
/>
|
|
||||||
</picture>
|
|
||||||
)
|
|
||||||
|
|
||||||
const Link = ({href, children}) => (
|
const Link = ({href, children}) => (
|
||||||
<a className="invisible" href={href}>
|
<a className="invisible" href={href}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in new issue
Block a user